History

lavfi: add error message to help users convert to new lavfi syntax.

Ronald S. Bultje committed 11 years ago

Commit ad7d9721 parent 22f85542 files · +15 −1Browse files

Unified · Split

2 files
  1. libavfilter/avfilter.c +12 −1
  2. libavfilter/version.h +3 −0
libavfilter/avfilter.c+12−1
@@ -895,7 +895,7 @@ int avfilter_init_str(AVFilterContext *filter, const char *args) · 894 unmodified lines
895895 return AVERROR(EINVAL);
896896 }
897897
898−#if FF_API_OLD_FILTER_OPTS
898+#if FF_API_OLD_FILTER_OPTS || FF_API_OLD_FILTER_OPTS_ERROR
899899 if ( !strcmp(filter->filter->name, "format") ||
900900 !strcmp(filter->filter->name, "noformat") ||
901901 !strcmp(filter->filter->name, "frei0r") ||
@@ -955,12 +955,23 @@ int avfilter_init_str(AVFilterContext *filter, const char *args) · 53 unmodified lines
955955 while ((p = strchr(p, ':')))
956956 *p++ = '|';
957957
958+#if FF_API_OLD_FILTER_OPTS
958959 if (deprecated)
959960 av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use "
960961 "'|' to separate the list items.\n");
961962
962963 av_log(filter, AV_LOG_DEBUG, "compat: called with args=[%s]\n", copy);
963964 ret = process_options(filter, &options, copy);
965+#else
966+ if (deprecated) {
967+ av_log(filter, AV_LOG_ERROR, "This syntax is deprecated. Use "
968+ "'|' to separate the list items ('%s' instead of '%s')\n",
969+ copy, args);
970+ ret = AVERROR(EINVAL);
971+ } else {
972+ ret = process_options(filter, &options, copy);
973+ }
974+#endif
964975 av_freep(&copy);
965976
966977 if (ret < 0)
libavfilter/version.h+3−0
@@ -61,6 +61,9 @@ · 60 unmodified lines
6161 #ifndef FF_API_OLD_FILTER_OPTS
6262 #define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 6)
6363 #endif
64+#ifndef FF_API_OLD_FILTER_OPTS_ERROR
65+#define FF_API_OLD_FILTER_OPTS_ERROR (LIBAVFILTER_VERSION_MAJOR < 7)
66+#endif
6467 #ifndef FF_API_AVFILTER_OPEN
6568 #define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 6)
6669 #endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t