[FFmpeg-cvslog] fftools/ffmpeg_demux: only call filter_codec_opts() when we have a decoder

Anton Khirnov git at videolan.org
Thu Mar 28 09:54:37 EET 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Mar 22 16:26:34 2024 +0100| [da678161286cd84d34d3582b4a2d9bca69e64374] | committer: Anton Khirnov

fftools/ffmpeg_demux: only call filter_codec_opts() when we have a decoder

It is pointless otherwise, as decoder options will not be used.

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

 fftools/ffmpeg_demux.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 47312c9fe1..73b0eb0da1 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -1329,10 +1329,12 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
     if (ret < 0)
         return ret;
 
-    ret = filter_codec_opts(o->g->codec_opts, ist->st->codecpar->codec_id,
-                            ic, st, ist->dec, &ds->decoder_opts);
-    if (ret < 0)
-        return ret;
+    if (ist->dec) {
+        ret = filter_codec_opts(o->g->codec_opts, ist->st->codecpar->codec_id,
+                                ic, st, ist->dec, &ds->decoder_opts);
+        if (ret < 0)
+            return ret;
+    }
 
     ds->reinit_filters = -1;
     MATCH_PER_STREAM_OPT(reinit_filters, i, ds->reinit_filters, ic, st);



More information about the ffmpeg-cvslog mailing list