]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/avfilter.c
Merge commit 'e67a87eac814c7805d18c983c43033a8a1bd62af'
[ffmpeg] / libavfilter / avfilter.c
index 25036fe3a403ff0e9ed256d188abc2e14f17af52..d81f672d74b37b7ddda7467ea5ef591de97a053c 100644 (file)
@@ -654,6 +654,9 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
     AVDictionaryEntry *e;
     int ret=0;
     int anton_options =
+        !strcmp(filter->filter->name,  "aformat") ||
+        !strcmp(filter->filter->name,   "format") ||
+        !strcmp(filter->filter->name, "noformat") ||
         !strcmp(filter->filter->name, "resample")
         ;
 
@@ -675,6 +678,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(&copy);
+
+            if (ret < 0)
+                goto fail;
+#endif
         } else {
             ret = process_unnamed_options(filter, &options, args);
             if (ret < 0)