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