Skip to content

Commit

Permalink
ALSA: pcm - Fix hwptr buffer-size overlap bug
Browse files Browse the repository at this point in the history
The fix 79452f0 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 <[email protected]>
  • Loading branch information
tiwai committed Jul 23, 2009
1 parent 8935064 commit 947ca21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/pcm_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 947ca21

Please sign in to comment.