提交 fb4bd0ad 编写于 作者: J Jaroslav Kysela

[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: NJaroslav Kysela <perex@suse.cz>
上级 21cb2a2e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册