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

It is pointless otherwise, as decoder options will not be used.
This commit is contained in:
Anton Khirnov 2024-03-22 16:26:34 +01:00
parent 56320880f7
commit da67816128
1 changed files with 6 additions and 4 deletions

View File

@ -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);