[FFmpeg-devel] [PATCH 02/12] fftools/ffmpeg_demux: only call filter_codec_opts() when we have a decoder
Anton Khirnov
anton at khirnov.net
Fri Mar 22 22:28:31 EET 2024
It is pointless otherwise, as decoder options will not be used.
---
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);
--
2.43.0
More information about the ffmpeg-devel
mailing list