[FFmpeg-cvslog] fftools/ffmpeg_enc: stop configuring filter inputs from encoder flush

Anton Khirnov git at videolan.org
Mon May 8 11:49:26 EEST 2023


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Apr 30 11:38:36 2023 +0200| [48d8d3549a1b97d6f811b7d0bed8b0fdb6a0dc6d] | committer: Anton Khirnov

fftools/ffmpeg_enc: stop configuring filter inputs from encoder flush

When no frames are ever seen by an encoder, encoder flush will do a
last-ditch attempt to configure its source filtergraph in order to at
least get the stream parameters. This involves extracting demuxer
parameters from filtergraph source inputs, which is
* a bad layering violation
* probably unreachable, because decoders are flushed before encoders,
  which should call ifilter_send_eof(), which will also set these
  parameters; however due to complex control flow it is hard to be
  entirely sure this code can never be triggered

Even if this code can actually be reached, it is probably better to
return an error as the comment above it says.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=48d8d3549a1b97d6f811b7d0bed8b0fdb6a0dc6d
---

 fftools/ffmpeg_enc.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index 53bf320afa..9b81d14922 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -1140,16 +1140,6 @@ void enc_flush(void)
                    "Finishing stream without any data written to it.\n");
 
             if (ost->filter && !fg->graph) {
-                int x;
-                for (x = 0; x < fg->nb_inputs; x++) {
-                    InputFilter *ifilter = fg->inputs[x];
-                    if (ifilter->format < 0 &&
-                        ifilter_parameters_from_codecpar(ifilter, ifilter->ist->par) < 0) {
-                        av_log(ost, AV_LOG_ERROR, "Error copying paramerets from input stream\n");
-                        exit_program(1);
-                    }
-                }
-
                 if (!ifilter_has_all_input_formats(fg))
                     continue;
 



More information about the ffmpeg-cvslog mailing list