diff mbox series

[FFmpeg-devel,06/24] fftools/thread_queue: count receive-finished streams as finished

Message ID 20231104092125.10213-7-anton@khirnov.net
State Accepted
Commit 87016e031ffa2ed99d466e99a1d7fc68f7bdd8e7
Headers show
Series [FFmpeg-devel,01/24] lavf/mux: do not apply max_interleave_delta to subtitles | expand

Commit Message

Anton Khirnov Nov. 4, 2023, 7:56 a.m. UTC
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 mbox series

Patch

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 */