summaryrefslogtreecommitdiff
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-02-25 21:21:29 +0100
committerAnton Khirnov <anton@khirnov.net>2013-04-09 19:04:45 +0200
commitc334c113d4d9e9a41bc38a3e4458d7ab21010401 (patch)
treeef17c5c25e3760fc8f6ce00acd981ab19d7540e4 /libavfilter/avfilter.c
parent5aa1a668cfae7f617e1a06efad20f87283badd8a (diff)
vf_scale: switch to an AVOptions-based system.
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 29b0583023..a92c4acf98 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -481,6 +481,36 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
int ret=0;
if (args && *args && filter->filter->priv_class) {
+#if FF_API_OLD_FILTER_OPTS
+ if (!strcmp(filter->filter->name, "scale") &&
+ strchr(args, ':') < strchr(args, '=')) {
+ /* old w:h:flags=<flags> syntax */
+ char *copy = av_strdup(args);
+ char *p;
+
+ av_log(filter, AV_LOG_WARNING, "The <w>:<h>:flags=<flags> option "
+ "syntax is deprecated. Use either <w>:<h>:<flags> or "
+ "w=<w>:h=<h>:flags=<flags>.\n");
+
+ if (!copy) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
+
+ p = strrchr(copy, ':');
+ if (p) {
+ *p++ = 0;
+ ret = av_dict_parse_string(&options, p, "=", ":", 0);
+ }
+ if (ret >= 0)
+ ret = process_unnamed_options(filter, &options, copy);
+ av_freep(&copy);
+
+ if (ret < 0)
+ goto fail;
+ } else
+#endif
+
if (strchr(args, '=')) {
/* assume a list of key1=value1:key2=value2:... */
ret = av_dict_parse_string(&options, args, "=", ":", 0);