]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/core/pcm_lib.c
Merge remote branch 'kumar/merge' into merge
[karo-tx-linux.git] / sound / core / pcm_lib.c
index a82e3756a72d8b95d49834e3ab61d08c6bf4d1d1..64449cb8f873774a91eb836973c1ab0a1ad2d9b8 100644 (file)
@@ -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)