summaryrefslogtreecommitdiffstats
path: root/sound/core/pcm_lib.c
diff options
context:
space:
mode:
authorGrant Likely2011-04-07 20:15:50 +0200
committerGrant Likely2011-04-07 20:15:50 +0200
commit454abcc57f1d48a976291bc4af73b5f087e21d70 (patch)
tree5bba999ea3f31527da02b60604531cc5fb52ea57 /sound/core/pcm_lib.c
parentgpio/pch_gpio: Fix output value of pch_gpio_direction_output() (diff)
parentLinux 2.6.39-rc2 (diff)
downloadkernel-qcow2-linux-454abcc57f1d48a976291bc4af73b5f087e21d70.tar.gz
kernel-qcow2-linux-454abcc57f1d48a976291bc4af73b5f087e21d70.tar.xz
kernel-qcow2-linux-454abcc57f1d48a976291bc4af73b5f087e21d70.zip
Merge commit 'v2.6.39-rc2' into spi/merge
Diffstat (limited to 'sound/core/pcm_lib.c')
-rw-r--r--sound/core/pcm_lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index a82e3756a72d..64449cb8f873 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -375,6 +375,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
}
if (runtime->no_period_wakeup) {
+ snd_pcm_sframes_t xrun_threshold;
/*
* Without regular period interrupts, we have to check
* the elapsed time to detect xruns.
@@ -383,7 +384,8 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
if (jdelta < runtime->hw_ptr_buffer_jiffies / 2)
goto no_delta_check;
hdelta = jdelta - delta * HZ / runtime->rate;
- while (hdelta > runtime->hw_ptr_buffer_jiffies / 2 + 1) {
+ xrun_threshold = runtime->hw_ptr_buffer_jiffies / 2 + 1;
+ while (hdelta > xrun_threshold) {
delta += runtime->buffer_size;
hw_base += runtime->buffer_size;
if (hw_base >= runtime->boundary)