summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@suse.cz>2005-05-31 15:44:23 +0200
committerJaroslav Kysela <perex@suse.cz>2005-06-22 12:27:57 +0200
commitfb4bd0adc4b5b6538933b098a67851d8f99b5ca3 (patch)
tree037e3550d67896813e8ff1b6e07b349adc6afd61 /sound
parent[ALSA] Fix races between PCM drain and other ops (diff)
downloadlinux-fb4bd0adc4b5b6538933b098a67851d8f99b5ca3.tar.xz
linux-fb4bd0adc4b5b6538933b098a67851d8f99b5ca3.zip
[ALSA] OSS PCM emulation - The final fix for SNDCTL_DSP_GETOPTR problem
ALSA<-OSS emulation The problem was negative result (info.bytes) in a specific condition at playback startup. Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/oss/pcm_oss.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 468fca8894d9..203470df5857 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -1539,10 +1539,13 @@ static int snd_pcm_oss_get_ptr(snd_pcm_oss_file_t *pcm_oss_file, int stream, str
} else {
delay = snd_pcm_oss_bytes(substream, delay) + fixup;
info.blocks = delay / runtime->oss.period_bytes;
- if (stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ if (runtime->oss.bytes == 0)
+ delay = 0;
info.bytes = (runtime->oss.bytes - delay) & INT_MAX;
- else
+ } else {
info.bytes = (runtime->oss.bytes + delay) & INT_MAX;
+ }
}
if (copy_to_user(_info, &info, sizeof(info)))
return -EFAULT;