Commit 6ed5eff0 authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Jaroslav Kysela

[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: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 17f48ec3
...@@ -971,7 +971,7 @@ static void snd_timer_s_function(unsigned long data) ...@@ -971,7 +971,7 @@ static void snd_timer_s_function(unsigned long data)
struct snd_timer_system_private *priv = timer->private_data; struct snd_timer_system_private *priv = timer->private_data;
unsigned long jiff = jiffies; unsigned long jiff = jiffies;
if (time_after(jiff, priv->last_expires)) 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); snd_timer_interrupt(timer, (long)jiff - (long)priv->last_jiffies);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment