X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffmpeg_opt.c;h=1d0cff20d709b1d2366223ee7620ffcacd37c492;hb=d6e87190fd0725f3517493f67dca6f8f264bb370;hp=23dbb3eba0319f545983334edbd0a529c1107ade;hpb=de31814ab07fd971d24c66a5e1ecf464b7ebe033;p=ffmpeg diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index 23dbb3eba03..1d0cff20d70 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -367,7 +367,7 @@ static int opt_map_channel(void *optctx, const char *opt, const char *arg) } /** - * Parse a metadata specifier in arg. + * Parse a metadata specifier passed as 'arg' parameter. * @param type metadata type is written here -- g(lobal)/s(tream)/c(hapter)/p(rogram) * @param index for type c/p, chapter/program index is written here * @param stream_spec for type s, the stream specifier is written here @@ -541,10 +541,8 @@ static AVCodec *choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream * return avcodec_find_decoder(st->codec->codec_id); } -/** - * Add all the streams from the given input file to the global - * list of input streams. - */ +/* Add all the streams from the given input file to the global + * list of input streams. */ static void add_input_streams(OptionsContext *o, AVFormatContext *ic) { int i; @@ -581,6 +579,9 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic) ist->dec = choose_decoder(o, ic, st); + ist->reinit_filters = -1; + MATCH_PER_STREAM_OPT(reinit_filters, i, ist->reinit_filters, ic, st); + switch (dec->codec_type) { case AVMEDIA_TYPE_VIDEO: if(!ist->dec) @@ -2160,7 +2161,7 @@ void show_help_default(const char *opt, const char *arg) const int per_file = OPT_SPEC | OPT_OFFSET | OPT_PERFILE; int show_advanced = 0, show_avoptions = 0; - if (opt) { + if (opt && *opt) { if (!strcmp(opt, "long")) show_advanced = 1; else if (!strcmp(opt, "full")) @@ -2343,6 +2344,8 @@ const OptionDef options[] = { "set profile", "profile" }, { "filter", HAS_ARG | OPT_STRING | OPT_SPEC, { .off = OFFSET(filters) }, "set stream filterchain", "filter_list" }, + { "reinit_filter", HAS_ARG | OPT_INT | OPT_SPEC, { .off = OFFSET(reinit_filters) }, + "reinit filtergraph on input parameter changes", "" }, { "filter_complex", HAS_ARG | OPT_EXPERT, { .func_arg = opt_filter_complex }, "create a complex filtergraph", "graph_description" }, { "stats", OPT_BOOL, { &print_stats },