Skip to content

Commit

Permalink
[ALSA] OSS PCM emulation - The final fix for SNDCTL_DSP_GETOPTR problem
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jaroslav Kysela committed Jun 22, 2005
1 parent 21cb2a2 commit fb4bd0a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sound/core/oss/pcm_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fb4bd0a

Please sign in to comment.