X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffplay.c;h=7cc5ab1644df82c79cc7cd28c692252619721d75;hb=b2d9d7226943d6229a17e31714ce5162bdf88b33;hp=139da9f872fb3098637ba002d9863e56a4550a6c;hpb=373bfe4fcaff48e0546662e818bfce7812bf75e7;p=ffmpeg diff --git a/ffplay.c b/ffplay.c index 139da9f872f..7cc5ab1644d 100644 --- a/ffplay.c +++ b/ffplay.c @@ -349,6 +349,7 @@ static int nb_vfilters = 0; static char *afilters = NULL; #endif static int autorotate = 1; +static int find_stream_info = 1; /* current context */ static int is_full_screen; @@ -2695,8 +2696,6 @@ static int read_thread(void *arg) int64_t stream_start_time; int pkt_in_play_range = 0; AVDictionaryEntry *t; - AVDictionary **opts; - int orig_nb_streams; SDL_mutex *wait_mutex = SDL_CreateMutex(); int scan_all_pmts_set = 0; int64_t pkt_ts; @@ -2746,20 +2745,22 @@ static int read_thread(void *arg) av_format_inject_global_side_data(ic); - opts = setup_find_stream_info_opts(ic, codec_opts); - orig_nb_streams = ic->nb_streams; + if (find_stream_info) { + AVDictionary **opts = setup_find_stream_info_opts(ic, codec_opts); + int orig_nb_streams = ic->nb_streams; - err = avformat_find_stream_info(ic, opts); + err = avformat_find_stream_info(ic, opts); - for (i = 0; i < orig_nb_streams; i++) - av_dict_free(&opts[i]); - av_freep(&opts); + for (i = 0; i < orig_nb_streams; i++) + av_dict_free(&opts[i]); + av_freep(&opts); - if (err < 0) { - av_log(NULL, AV_LOG_WARNING, - "%s: could not find codec parameters\n", is->filename); - ret = -1; - goto fail; + if (err < 0) { + av_log(NULL, AV_LOG_WARNING, + "%s: could not find codec parameters\n", is->filename); + ret = -1; + goto fail; + } } if (ic->pb) @@ -3512,7 +3513,7 @@ static int opt_codec(void *optctx, const char *opt, const char *arg) static int dummy; static const OptionDef options[] = { -#include "cmdutils_common_opts.h" + CMDUTILS_COMMON_OPTIONS { "x", HAS_ARG, { .func_arg = opt_width }, "force displayed width", "width" }, { "y", HAS_ARG, { .func_arg = opt_height }, "force displayed height", "height" }, { "s", HAS_ARG | OPT_VIDEO, { .func_arg = opt_frame_size }, "set frame size (WxH or abbreviation)", "size" }, @@ -3557,6 +3558,8 @@ static const OptionDef options[] = { { "scodec", HAS_ARG | OPT_STRING | OPT_EXPERT, { &subtitle_codec_name }, "force subtitle decoder", "decoder_name" }, { "vcodec", HAS_ARG | OPT_STRING | OPT_EXPERT, { &video_codec_name }, "force video decoder", "decoder_name" }, { "autorotate", OPT_BOOL, { &autorotate }, "automatically rotate video", "" }, + { "find_stream_info", OPT_BOOL | OPT_INPUT | OPT_EXPERT, { &find_stream_info }, + "read and decode the streams to fill missing information with heuristics" }, { NULL, }, };