summaryrefslogtreecommitdiff
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-07-23 16:21:08 +0200
committerTakashi Iwai <tiwai@suse.de>2009-07-23 16:21:08 +0200
commit947ca210f1df7656e19890832cb71fc3bdd88707 (patch)
tree097d132f03886a3aae96856d7d8570df08552ec8 /sound/core
parent89350640439e0160056de26995d52deb18202b3e (diff)
ALSA: pcm - Fix hwptr buffer-size overlap bug
The fix 79452f0a28aa5a40522c487b42a5fc423647ad98 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>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm_lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index d315f72949f..72cfd47af6b 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -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,