diff mbox series

[FFmpeg-devel,5/5] fftools/ffmpeg: make demuxing with one file always blocking

Message ID 20221108112550.8375-5-anton@khirnov.net
State Accepted
Commit 822da7a31746b8a5ec92c854b52bc767e6e98e8a
Headers show
Series [FFmpeg-devel,1/5] lavf/rtpdec_asf: set AVFMT_FLAG_NONBLOCK | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
yinshiyou/configure_loongarch64 warning Failed to run configure

Commit Message

Anton Khirnov Nov. 8, 2022, 11:25 a.m. UTC
---
 fftools/ffmpeg_demux.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 8ea5318148..b32bac217d 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -363,8 +363,9 @@  static int thread_start(Demuxer *d)
     if (d->thread_queue_size <= 0)
         d->thread_queue_size = (nb_input_files > 1 ? 8 : 1);
 
-    if (f->ctx->pb ? !f->ctx->pb->seekable :
-        strcmp(f->ctx->iformat->name, "lavfi"))
+    if (nb_input_files > 1 &&
+        (f->ctx->pb ? !f->ctx->pb->seekable :
+         strcmp(f->ctx->iformat->name, "lavfi")))
         d->non_blocking = 1;
     ret = av_thread_message_queue_alloc(&d->in_thread_queue,
                                         d->thread_queue_size, sizeof(DemuxMsg));