diff mbox series

[FFmpeg-devel,4/5] fftools/ffmpeg_demux: do not set AVFMT_FLAG_NONBLOCK

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

Checks

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

Commit Message

Anton Khirnov Nov. 8, 2022, 11:25 a.m. UTC
This is pointless now that demuxing always runs in a separate thread.

Remove special handling for AVERROR(EAGAIN), which should never be
returned now.
---
 fftools/ffmpeg_demux.c | 6 ------
 1 file changed, 6 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index ee867cc15c..8ea5318148 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -254,11 +254,6 @@  static void *input_thread(void *arg)
         DemuxMsg msg = { NULL };
 
         ret = av_read_frame(f->ctx, pkt);
-
-        if (ret == AVERROR(EAGAIN)) {
-            av_usleep(10000);
-            continue;
-        }
         if (ret < 0) {
             if (d->loop) {
                 /* signal looping to the consumer thread */
@@ -917,7 +912,6 @@  int ifile_open(OptionsContext *o, const char *filename)
     ic->subtitle_codec_id  = subtitle_codec_name ? ic->subtitle_codec->id : AV_CODEC_ID_NONE;
     ic->data_codec_id      = data_codec_name     ? ic->data_codec->id     : AV_CODEC_ID_NONE;
 
-    ic->flags |= AVFMT_FLAG_NONBLOCK;
     if (o->bitexact)
         ic->flags |= AVFMT_FLAG_BITEXACT;
     ic->interrupt_callback = int_cb;