fftools/cmdutils: return error codes from setup_find_stream_info_opts() instead of aborting

This commit is contained in:
Anton Khirnov
2023-07-13 15:11:07 +02:00
parent 13ebc9a0a9
commit 37abb3a419
5 changed files with 39 additions and 17 deletions

View File

@@ -1482,9 +1482,13 @@ int ifile_open(const OptionsContext *o, const char *filename)
choose_decoder(o, ic, ic->streams[i], HWACCEL_NONE, AV_HWDEVICE_TYPE_NONE);
if (o->find_stream_info) {
AVDictionary **opts = setup_find_stream_info_opts(ic, o->g->codec_opts);
AVDictionary **opts;
int orig_nb_streams = ic->nb_streams;
ret = setup_find_stream_info_opts(ic, o->g->codec_opts, &opts);
if (ret < 0)
return ret;
/* If not enough info to get the stream parameters, we decode the
first frames to get it. (used in mpeg case for example) */
ret = avformat_find_stream_info(ic, opts);