From aa0e0043d383d6d38a1d0841680b70551176a809 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 9 Mar 2021 13:21:50 +0100 Subject: [PATCH] alsa: only recompute threshold when quantum changes --- 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 5b0c03241..847b627f1 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -1340,7 +1340,7 @@ static void alsa_on_timeout_event(struct spa_source *source) if (SPA_UNLIKELY(state->started && spa_system_timerfd_read(state->data_system, state->timerfd, &expire) < 0)) spa_log_warn(state->log, NAME" %p: error reading timerfd: %m", state); - if (SPA_LIKELY(state->position)) { + if (SPA_UNLIKELY(state->position && state->duration != state->position->clock.duration)) { state->duration = state->position->clock.duration; state->threshold = (state->duration * state->rate + state->rate_denom-1) / state->rate_denom; }