mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
ALSA: pcm - Fix hwptr buffer-size overlap bug
The fix 79452f0a28
introduced another
bug due to the missing offset for the overlapped hwptr.
When the hwptr goes back to zero, the delta value has to be corrected
with the buffer size. Otherwise this causes looping sounds.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
8935064043
commit
947ca210f1
@ -256,7 +256,7 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
|
||||
delta = new_hw_ptr - hw_ptr_interrupt;
|
||||
}
|
||||
if (delta < 0) {
|
||||
if (runtime->periods == 1)
|
||||
if (runtime->periods == 1 || new_hw_ptr < old_hw_ptr)
|
||||
delta += runtime->buffer_size;
|
||||
if (delta < 0) {
|
||||
hw_ptr_error(substream,
|
||||
|
Loading…
Reference in New Issue
Block a user