X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=sound%2Fcore%2Fpcm_lib.c;h=64449cb8f873774a91eb836973c1ab0a1ad2d9b8;hb=8f3dda75cb942acc049adb2c95a6e5f4c3a8a410;hp=a82e3756a72d8b95d49834e3ab61d08c6bf4d1d1;hpb=0bc0be7f20efea664b7c4c1d0b1822bc8f53a8b4;p=karo-tx-linux.git 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)