From a36af57899ef940082ce56131004072d4445fa11 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 3 Mar 2021 17:01:12 +0100 Subject: [PATCH] alsa: reschedule the timeout based on new quantum Always reschedule the timeout based on the new quantum. If the quantum descreased we want to wait some more until the buffer only has the new quantum of samples left. --- spa/plugins/alsa/alsa-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index d7a5b4101..d8a9d75c0 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -1264,7 +1264,7 @@ static int handle_play(struct state *state, uint64_t nsec, { int res; - if (SPA_UNLIKELY(delay > target + state->last_threshold)) { + if (SPA_UNLIKELY(delay > target + state->threshold)) { spa_log_trace(state->log, NAME" %p: early wakeup %ld %ld", state, delay, target); state->next_time = nsec + (delay - target) * SPA_NSEC_PER_SEC / state->rate; return -EAGAIN;