diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-02-25 21:21:29 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-04-09 18:56:39 +0200 |
commit | e67a87eac814c7805d18c983c43033a8a1bd62af (patch) | |
tree | d5fad4b282033b3736dcc4da93f0e2279fdfdbf4 /libavfilter/avfilter.c | |
parent | 0af7fe1f95a9e4a25e7e46f386360c701c49763d (diff) | |
download | ffmpeg-e67a87eac814c7805d18c983c43033a8a1bd62af.tar.gz |
vf_(no)format: switch to an AVOptions-based system.
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r-- | libavfilter/avfilter.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index a8429aac3e..e5a7f13464 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -486,6 +486,33 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque ret = av_dict_parse_string(&options, args, "=", ":", 0); if (ret < 0) goto fail; +#if FF_API_OLD_FILTER_OPTS + } else if (!strcmp(filter->filter->name, "format") || + !strcmp(filter->filter->name, "noformat")) { + /* a hack for compatibility with the old syntax + * replace colons with |s */ + char *copy = av_strdup(args); + char *p = copy; + + if (!copy) { + ret = AVERROR(ENOMEM); + goto fail; + } + + if (strchr(copy, ':')) { + av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use " + "'|' to separate the list items.\n"); + } + + while ((p = strchr(p, ':'))) + *p++ = '|'; + + ret = process_unnamed_options(filter, &options, copy); + av_freep(©); + + if (ret < 0) + goto fail; +#endif } else { ret = process_unnamed_options(filter, &options, args); if (ret < 0) |