]> git.sesse.net Git - ffmpeg/commitdiff
lavfi: add error message to help users convert to new lavfi syntax.
authorRonald S. Bultje <rsbultje@gmail.com>
Tue, 18 Aug 2015 00:04:57 +0000 (20:04 -0400)
committerRonald S. Bultje <rsbultje@gmail.com>
Tue, 18 Aug 2015 14:18:43 +0000 (10:18 -0400)
libavfilter/avfilter.c
libavfilter/version.h

index 700baa29ccee69c07617e37c64aa4ec6e84dd3ca..6475f29f26da692f58574fc54d6ace398db458db 100644 (file)
@@ -895,7 +895,7 @@ int avfilter_init_str(AVFilterContext *filter, const char *args)
             return AVERROR(EINVAL);
         }
 
-#if FF_API_OLD_FILTER_OPTS
+#if FF_API_OLD_FILTER_OPTS || FF_API_OLD_FILTER_OPTS_ERROR
             if (   !strcmp(filter->filter->name, "format")     ||
                    !strcmp(filter->filter->name, "noformat")   ||
                    !strcmp(filter->filter->name, "frei0r")     ||
@@ -955,12 +955,23 @@ int avfilter_init_str(AVFilterContext *filter, const char *args)
             while ((p = strchr(p, ':')))
                 *p++ = '|';
 
+#if FF_API_OLD_FILTER_OPTS
             if (deprecated)
                 av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use "
                        "'|' to separate the list items.\n");
 
             av_log(filter, AV_LOG_DEBUG, "compat: called with args=[%s]\n", copy);
             ret = process_options(filter, &options, copy);
+#else
+            if (deprecated) {
+                av_log(filter, AV_LOG_ERROR, "This syntax is deprecated. Use "
+                       "'|' to separate the list items ('%s' instead of '%s')\n",
+                       copy, args);
+                ret = AVERROR(EINVAL);
+            } else {
+                ret = process_options(filter, &options, copy);
+            }
+#endif
             av_freep(&copy);
 
             if (ret < 0)
index 90a6dc05b1647fb0e653efa0cc5901e9967b254c..6fc41451ed1beda3750fc235605287ef22505741 100644 (file)
@@ -61,6 +61,9 @@
 #ifndef FF_API_OLD_FILTER_OPTS
 #define FF_API_OLD_FILTER_OPTS              (LIBAVFILTER_VERSION_MAJOR < 6)
 #endif
+#ifndef FF_API_OLD_FILTER_OPTS_ERROR
+#define FF_API_OLD_FILTER_OPTS_ERROR        (LIBAVFILTER_VERSION_MAJOR < 7)
+#endif
 #ifndef FF_API_AVFILTER_OPEN
 #define FF_API_AVFILTER_OPEN                (LIBAVFILTER_VERSION_MAJOR < 6)
 #endif