Skip to content

Commit

Permalink
[ALSA] system timer: fix lost ticks correction adjustment
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Clemens Ladisch authored and Jaroslav Kysela committed Sep 23, 2006
1 parent 7bc5ba7 commit 17f48ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 17f48ec

Please sign in to comment.