From: Clemens Ladisch Date: Mon, 17 Jul 2006 14:51:37 +0000 (+0200) Subject: [ALSA] system timer: accumulate correction for multiple lost ticks X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6ed5eff025b72cb84a884d4be05f854f13b1542f;p=linux-beck.git [ALSA] system timer: accumulate correction for multiple lost ticks When multiple timer interrupts arrive too late, correct for all delays instead of ignoring the earlier ones. Signed-off-by: Clemens Ladisch Signed-off-by: Jaroslav Kysela --- diff --git a/sound/core/timer.c b/sound/core/timer.c index 86357007259d..0f6e6727ff7c 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -971,7 +971,7 @@ static void snd_timer_s_function(unsigned long data) struct snd_timer_system_private *priv = timer->private_data; unsigned long jiff = jiffies; if (time_after(jiff, priv->last_expires)) - priv->correction = (long)jiff - (long)priv->last_expires; + priv->correction += (long)jiff - (long)priv->last_expires; snd_timer_interrupt(timer, (long)jiff - (long)priv->last_jiffies); }