From 4b5b94303e4fec8a37ec599e264053dfa99d87de Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 5 May 2023 18:36:08 +0200 Subject: [PATCH] loop: clear rmask after dispatching all sources To make the unit tests work again. --- spa/plugins/support/loop.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spa/plugins/support/loop.c b/spa/plugins/support/loop.c index 832779bf1..bae9f27ef 100644 --- a/spa/plugins/support/loop.c +++ b/spa/plugins/support/loop.c @@ -475,11 +475,14 @@ static int loop_iterate(void *object, int timeout) if (SPA_UNLIKELY(!spa_list_is_empty(&impl->destroy_list))) process_destroy(impl); + for (i = 0; i < nfds; i++) { + struct spa_source *s = ep[i].data; + if (SPA_LIKELY(s && s->rmask)) + s->func(s); + } for (i = 0; i < nfds; i++) { struct spa_source *s = ep[i].data; if (SPA_LIKELY(s)) { - if (SPA_LIKELY(s->rmask)) - s->func(s); s->rmask = 0; s->priv = NULL; }