diff options
author | Wim Taymans <wtaymans@redhat.com> | 2019-12-18 13:27:29 +0100 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2019-12-18 13:27:29 +0100 |
commit | 9657486a81dc67a7daa030b57b3c2a3df75656cf (patch) | |
tree | 8f0ac35ed985de1aa434270162484d01931cf07e | |
parent | 686a5cf47e4b2dda6e9513843dea20eedb6fd35f (diff) |
alsa-seq: update duration when slaved as well
-rw-r--r-- | spa/plugins/alsa/alsa-seq.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spa/plugins/alsa/alsa-seq.c b/spa/plugins/alsa/alsa-seq.c index aa9e647f..675aae81 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); |