aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@suse.cz>2005-05-31 10:59:39 -0400
committerJaroslav Kysela <perex@suse.cz>2005-06-22 06:28:03 -0400
commit5ac0fab95c09497bed24640eb3f09893127d6d65 (patch)
treee7b83b9701d9fd3812404356968697ab40c466b6 /sound/core
parent98c7f2121d4263867710df3b5124980e25261188 (diff)
[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>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/oss/pcm_oss.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 203470df5857..cab30977e7c0 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
1537 snd_pcm_oss_simulate_fill(substream, delay); 1537 snd_pcm_oss_simulate_fill(substream, delay);
1538 info.bytes = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr) & INT_MAX; 1538 info.bytes = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr) & INT_MAX;
1539 } else { 1539 } else {
1540 delay = snd_pcm_oss_bytes(substream, delay) + fixup; 1540 delay = snd_pcm_oss_bytes(substream, delay);
1541 info.blocks = delay / runtime->oss.period_bytes;
1542 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { 1541 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
1543 if (runtime->oss.bytes == 0) 1542 info.blocks = (runtime->oss.buffer_bytes - delay - fixup) / runtime->oss.period_bytes;
1544 delay = 0;
1545 info.bytes = (runtime->oss.bytes - delay) & INT_MAX; 1543 info.bytes = (runtime->oss.bytes - delay) & INT_MAX;
1546 } else { 1544 } else {
1545 delay += fixup;
1546 info.blocks = delay / runtime->oss.period_bytes;
1547 info.bytes = (runtime->oss.bytes + delay) & INT_MAX; 1547 info.bytes = (runtime->oss.bytes + delay) & INT_MAX;
1548 } 1548 }
1549 } 1549 }