]> err.no Git - linux-2.6/commitdiff
[ALSA] system timer: accumulate correction for multiple lost ticks
authorClemens Ladisch <clemens@ladisch.de>
Mon, 17 Jul 2006 14:51:37 +0000 (16:51 +0200)
committerJaroslav Kysela <perex@suse.cz>
Sat, 23 Sep 2006 08:38:03 +0000 (10:38 +0200)
When multiple timer interrupts arrive too late, correct for all delays
instead of ignoring the earlier ones.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/core/timer.c

index 86357007259d19b013ece712ba7286ca7f5ac7b3..0f6e6727ff7c576944baf90f8241becd681acc1a 100644 (file)
@@ -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);
 }