From 9657486a81dc67a7daa030b57b3c2a3df75656cf Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 18 Dec 2019 13:27:29 +0100 Subject: [PATCH] alsa-seq: update duration when slaved as well --- spa/plugins/alsa/alsa-seq.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spa/plugins/alsa/alsa-seq.c b/spa/plugins/alsa/alsa-seq.c index aa9e647f1..675aae81d 100644 --- a/spa/plugins/alsa/alsa-seq.c +++ b/spa/plugins/alsa/alsa-seq.c @@ -655,6 +655,13 @@ static int update_time(struct seq_state *state, uint64_t nsec, bool slave) double err, corr; uint64_t clock_elapsed, queue_elapsed; + if (state->position) { + struct spa_io_clock *clock = &state->position->clock; + state->rate = clock->rate; + state->duration = clock->duration; + state->threshold = state->duration; + } + /* take queue time */ snd_seq_queue_status_alloca(&status); snd_seq_get_queue_status(state->event.hndl, state->event.queue_id, status); @@ -741,13 +748,6 @@ static void alsa_on_timeout_event(struct spa_source *source) spa_log_trace(state->log, "timeout %"PRIu64, state->current_time); - if (state->position) { - struct spa_io_clock *clock = &state->position->clock; - state->rate = clock->rate; - state->duration = clock->duration; - state->threshold = state->duration; - } - update_time(state, state->current_time, false); res = process_read(state);