]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/avfilter.c
lavfi: add error message to help users convert to new lavfi syntax.
[ffmpeg] / libavfilter / avfilter.c
index d43d8136ba65af6a400ca8d0f3e25320a45ef143..6475f29f26da692f58574fc54d6ace398db458db 100644 (file)
@@ -508,8 +508,10 @@ int avfilter_register(AVFilter *filter)
 
     for(i=0; filter->inputs && filter->inputs[i].name; i++) {
         const AVFilterPad *input = &filter->inputs[i];
+#if FF_API_AVFILTERPAD_PUBLIC
         av_assert0(     !input->filter_frame
                     || (!input->start_frame && !input->end_frame));
+#endif
     }
 
     filter->next = NULL;
@@ -893,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")     ||
@@ -953,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)