]> err.no Git - linux-2.6/commitdiff
[ALSA] system timer: fix lost ticks correction adjustment
authorClemens Ladisch <clemens@ladisch.de>
Mon, 17 Jul 2006 14:50:56 +0000 (16:50 +0200)
committerJaroslav Kysela <perex@suse.cz>
Sat, 23 Sep 2006 08:37:58 +0000 (10:37 +0200)
Fix the adjustment of the lost ticks correction variable in the case
when the correction has been fully taken into account in the next timer
expiration value.  Subtracting the scheduled ticks value would result in
an underflow.

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

index 7e5e562fe356e3b52181b7ac0b575c0e4b548682..86357007259d19b013ece712ba7286ca7f5ac7b3 100644 (file)
@@ -987,7 +987,7 @@ static int snd_timer_s_start(struct snd_timer * timer)
                njiff++;
        } else {
                njiff += timer->sticks - priv->correction;
-               priv->correction -= timer->sticks;
+               priv->correction = 0;
        }
        priv->last_expires = priv->tlist.expires = njiff;
        add_timer(&priv->tlist);