diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-10-25 03:56:32 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-10-25 03:56:32 -0400 |
commit | 79fc84c7e0d2fe89c4e82f3a26fd8b0d13c31703 (patch) | |
tree | e32a4c267dc1b5950012e18c1e71d8057140f1f5 /sound/core/pcm_lib.c | |
parent | f6f94e2ab1b33f0082ac22d71f66385a60d8157f (diff) | |
parent | 97c44b2dbd0060e2e6bd56236eb638ab02ec7f30 (diff) |
Merge branch 'topic/misc' into for-linus
Diffstat (limited to 'sound/core/pcm_lib.c')
-rw-r--r-- | sound/core/pcm_lib.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index e23e0e7ab26..a1707cca9c6 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -334,11 +334,15 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, | |||
334 | /* delta = "expected next hw_ptr" for in_interrupt != 0 */ | 334 | /* delta = "expected next hw_ptr" for in_interrupt != 0 */ |
335 | delta = runtime->hw_ptr_interrupt + runtime->period_size; | 335 | delta = runtime->hw_ptr_interrupt + runtime->period_size; |
336 | if (delta > new_hw_ptr) { | 336 | if (delta > new_hw_ptr) { |
337 | hw_base += runtime->buffer_size; | 337 | /* check for double acknowledged interrupts */ |
338 | if (hw_base >= runtime->boundary) | 338 | hdelta = jiffies - runtime->hw_ptr_jiffies; |
339 | hw_base = 0; | 339 | if (hdelta > runtime->hw_ptr_buffer_jiffies/2) { |
340 | new_hw_ptr = hw_base + pos; | 340 | hw_base += runtime->buffer_size; |
341 | goto __delta; | 341 | if (hw_base >= runtime->boundary) |
342 | hw_base = 0; | ||
343 | new_hw_ptr = hw_base + pos; | ||
344 | goto __delta; | ||
345 | } | ||
342 | } | 346 | } |
343 | } | 347 | } |
344 | /* new_hw_ptr might be lower than old_hw_ptr in case when */ | 348 | /* new_hw_ptr might be lower than old_hw_ptr in case when */ |