From 51b3778f7c3b5aebc248808033b7c24763f6a08c Mon Sep 17 00:00:00 2001 From: David Coles Date: Fri, 28 Jun 2024 16:49:59 -0700 Subject: [PATCH] loop: fix update_timer handling of solo repeat argument I believe the intent here is that if a `interval` is provided but `value` is unset, then `value` should default to `period` so the timer first fires after one `interval`. Since `interval` is always a relative duration, `value` should be interpreted as a relative duration, not an absolute one. --- spa/plugins/support/loop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spa/plugins/support/loop.c b/spa/plugins/support/loop.c index aae27b732..11ac7235d 100644 --- a/spa/plugins/support/loop.c +++ b/spa/plugins/support/loop.c @@ -884,8 +884,9 @@ loop_update_timer(void *object, struct spa_source *source, if (SPA_LIKELY(value)) { its.it_value = *value; } else if (interval) { + // timer initially fires after one interval its.it_value = *interval; - absolute = true; + absolute = false; } if (SPA_UNLIKELY(interval)) its.it_interval = *interval;