diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-24 17:30:52 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-24 17:41:31 +0100 |
commit | 6db37c9468051ff34cac58fa428bc5d86fc1ee45 (patch) | |
tree | ac578a2ae106cb9a15f37769a87f5d4cf1dd3405 /cmdutils.c | |
parent | 71cf094e1be086bce4c535b1fe0d96a0449486ae (diff) | |
parent | 5c7db097ebe1fb5c233cedd8846615074e7d6044 (diff) | |
download | ffmpeg-6db37c9468051ff34cac58fa428bc5d86fc1ee45.tar.gz |
Merge commit '5c7db097ebe1fb5c233cedd8846615074e7d6044'
* commit '5c7db097ebe1fb5c233cedd8846615074e7d6044':
avconv: pass libavresample options to AVFilterGraph
Conflicts:
cmdutils.c
cmdutils.h
ffmpeg_filter.c
ffmpeg_opt.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/cmdutils.c b/cmdutils.c index 7c2117637e..50a1ff8d72 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -63,7 +63,7 @@ static int init_report(const char *env); struct SwsContext *sws_opts; SwrContext *swr_opts; -AVDictionary *format_opts, *codec_opts; +AVDictionary *format_opts, *codec_opts, *resample_opts; const int this_year = 2013; @@ -92,6 +92,7 @@ void uninit_opts(void) av_dict_free(&format_opts); av_dict_free(&codec_opts); + av_dict_free(&resample_opts); } void log_callback_help(void *ptr, int level, const char *fmt, va_list vl) @@ -478,6 +479,7 @@ int opt_default(void *optctx, const char *opt, const char *arg) char opt_stripped[128]; const char *p; const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class(); + const av_unused AVClass *rc_class; const AVClass *sc, *swr_class; if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug")) @@ -526,6 +528,14 @@ int opt_default(void *optctx, const char *opt, const char *arg) consumed = 1; } #endif +#if CONFIG_AVRESAMPLE + rc_class = avresample_get_class(); + if (av_opt_find(&rc_class, opt, NULL, 0, + AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) { + av_dict_set(&resample_opts, opt, arg, FLAGS); + consumed = 1; + } +#endif if (consumed) return 0; @@ -575,9 +585,11 @@ static void finish_group(OptionParseContext *octx, int group_idx, g->swr_opts = swr_opts; g->codec_opts = codec_opts; g->format_opts = format_opts; + g->resample_opts = resample_opts; codec_opts = NULL; format_opts = NULL; + resample_opts = NULL; #if CONFIG_SWSCALE sws_opts = NULL; #endif @@ -635,6 +647,7 @@ void uninit_parse_context(OptionParseContext *octx) av_freep(&l->groups[j].opts); av_dict_free(&l->groups[j].codec_opts); av_dict_free(&l->groups[j].format_opts); + av_dict_free(&l->groups[j].resample_opts); #if CONFIG_SWSCALE sws_freeContext(l->groups[j].sws_opts); #endif @@ -748,7 +761,7 @@ do { \ return AVERROR_OPTION_NOT_FOUND; } - if (octx->cur_group.nb_opts || codec_opts || format_opts) + if (octx->cur_group.nb_opts || codec_opts || format_opts || resample_opts) av_log(NULL, AV_LOG_WARNING, "Trailing options were found on the " "commandline.\n"); |