소스 검색

[ALSA] system timer: fix lost ticks correction adjustment

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>
Clemens Ladisch 19 년 전
부모
커밋
17f48ec3f1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      sound/core/timer.c

+ 1 - 1
sound/core/timer.c

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