From 87016e031ffa2ed99d466e99a1d7fc68f7bdd8e7 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 18 Oct 2023 12:02:42 +0200 Subject: [PATCH] fftools/thread_queue: count receive-finished streams as finished This ensures that tq_receive() will always return EOF after all streams were receive-finished, even though the sending side might not have closed them yet. This may allow the receiver to avoid manually tracking which streams it has already closed. --- fftools/thread_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/thread_queue.c b/fftools/thread_queue.c index feac6a7748..fd73cc0a9b 100644 --- a/fftools/thread_queue.c +++ b/fftools/thread_queue.c @@ -177,7 +177,7 @@ static int receive_locked(ThreadQueue *tq, int *stream_idx, } for (unsigned int i = 0; i < tq->nb_streams; i++) { - if (!(tq->finished[i] & FINISHED_SEND)) + if (!tq->finished[i]) continue; /* return EOF to the consumer at most once for each stream */