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.
This commit is contained in:
David Coles 2024-06-28 16:49:59 -07:00 committed by Wim Taymans
parent 8dfae10746
commit 51b3778f7c

View file

@ -884,8 +884,9 @@ loop_update_timer(void *object, struct spa_source *source,
if (SPA_LIKELY(value)) { if (SPA_LIKELY(value)) {
its.it_value = *value; its.it_value = *value;
} else if (interval) { } else if (interval) {
// timer initially fires after one interval
its.it_value = *interval; its.it_value = *interval;
absolute = true; absolute = false;
} }
if (SPA_UNLIKELY(interval)) if (SPA_UNLIKELY(interval))
its.it_interval = *interval; its.it_interval = *interval;