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 0b39c4ec68
commit 2770e96e08

View file

@ -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;