diff options
author | Jaroslav Kysela <perex@suse.cz> | 2005-05-31 14:59:39 (GMT) |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-06-22 10:28:03 (GMT) |
commit | 5ac0fab95c09497bed24640eb3f09893127d6d65 (patch) | |
tree | e7b83b9701d9fd3812404356968697ab40c466b6 | |
parent | 98c7f2121d4263867710df3b5124980e25261188 (diff) | |
download | linux-fsl-qoriq-5ac0fab95c09497bed24640eb3f09893127d6d65.tar.xz |
[ALSA] OSS PCM emulation - The 2nd final fix for SNDCTL_DSP_GETOPTR problem
ALSA<-OSS emulation
The problem was negative/wrong result (info.bytes) in a specific condition at
playback startup.
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r-- | sound/core/oss/pcm_oss.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 203470d..cab3097 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -1537,13 +1537,13 @@ static int snd_pcm_oss_get_ptr(snd_pcm_oss_file_t *pcm_oss_file, int stream, str snd_pcm_oss_simulate_fill(substream, delay); info.bytes = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr) & INT_MAX; } else { - delay = snd_pcm_oss_bytes(substream, delay) + fixup; - info.blocks = delay / runtime->oss.period_bytes; + delay = snd_pcm_oss_bytes(substream, delay); if (stream == SNDRV_PCM_STREAM_PLAYBACK) { - if (runtime->oss.bytes == 0) - delay = 0; + info.blocks = (runtime->oss.buffer_bytes - delay - fixup) / runtime->oss.period_bytes; info.bytes = (runtime->oss.bytes - delay) & INT_MAX; } else { + delay += fixup; + info.blocks = delay / runtime->oss.period_bytes; info.bytes = (runtime->oss.bytes + delay) & INT_MAX; } } |