summaryrefslogtreecommitdiff
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-01-13 10:32:53 +0300
committerTakashi Iwai <tiwai@suse.de>2010-01-13 10:32:53 +0300
commit47e91348459901c30cc1bb4897e62ced21ca243a (patch)
treeebc855a2f3686726fb68b6b173af54ee75b44c61 /sound/core
parent6b98515a620592636d2f8e0d3e2942d1cb4847ec (diff)
parented69c6a8eef679f2783848ed624897a937a434ac (diff)
downloadlinux-47e91348459901c30cc1bb4897e62ced21ca243a.tar.xz
Merge branch 'devel' of git.alsa-project.org:alsa-kernel into topic/misc
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm_lib.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 0403a7d55f0c..720019560794 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -394,6 +394,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
+ HZ/100);
/* move new_hw_ptr according jiffies not pos variable */
new_hw_ptr = old_hw_ptr;
+ hw_base = delta;
/* use loop to avoid checks for delta overflows */
/* the delta value is small or zero in most cases */
while (delta > 0) {
@@ -403,8 +404,6 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
delta--;
}
/* align hw_base to buffer_size */
- hw_base = new_hw_ptr - (new_hw_ptr % runtime->buffer_size);
- delta = 0;
hw_ptr_error(substream,
"hw_ptr skipping! %s"
"(pos=%ld, delta=%ld, period=%ld, "
@@ -412,9 +411,12 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
in_interrupt ? "[Q] " : "",
(long)pos, (long)hdelta,
(long)runtime->period_size, jdelta,
- ((hdelta * HZ) / runtime->rate), delta,
+ ((hdelta * HZ) / runtime->rate), hw_base,
(unsigned long)old_hw_ptr,
(unsigned long)new_hw_ptr);
+ /* reset values to proper state */
+ delta = 0;
+ hw_base = new_hw_ptr - (new_hw_ptr % runtime->buffer_size);
}
no_jiffies_check:
if (delta > runtime->period_size + runtime->period_size / 2) {