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
895 return AVERROR(EINVAL);895 return AVERROR(EINVAL);
896 }896 }
897 897
898#if FF_API_OLD_FILTER_OPTS898#if FF_API_OLD_FILTER_OPTS || FF_API_OLD_FILTER_OPTS_ERROR
899 if ( !strcmp(filter->filter->name, "format") ||899 if ( !strcmp(filter->filter->name, "format") ||
900 !strcmp(filter->filter->name, "noformat") ||900 !strcmp(filter->filter->name, "noformat") ||
901 !strcmp(filter->filter->name, "frei0r") ||901 !strcmp(filter->filter->name, "frei0r") ||
@@ -955,12 +955,23 @@ int avfilter_init_str(AVFilterContext *filter, const char *args) · 53 unmodified lines
955 while ((p = strchr(p, ':')))955 while ((p = strchr(p, ':')))
956 *p++ = '|';956 *p++ = '|';
957 957
958#if FF_API_OLD_FILTER_OPTS
958 if (deprecated)959 if (deprecated)
959 av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use "960 av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use "
960 "'|' to separate the list items.\n");961 "'|' to separate the list items.\n");
961 962
962 av_log(filter, AV_LOG_DEBUG, "compat: called with args=[%s]\n", copy);963 av_log(filter, AV_LOG_DEBUG, "compat: called with args=[%s]\n", copy);
963 ret = process_options(filter, &options, copy);964 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
964 av_freep(&copy);975 av_freep(&copy);
965 976
966 if (ret < 0)977 if (ret < 0)
libavfilter/version.h+3−0
@@ -61,6 +61,9 @@ · 60 unmodified lines
61#ifndef FF_API_OLD_FILTER_OPTS61#ifndef FF_API_OLD_FILTER_OPTS
62#define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 6)62#define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 6)
63#endif63#endif
64#ifndef FF_API_OLD_FILTER_OPTS_ERROR
65#define FF_API_OLD_FILTER_OPTS_ERROR (LIBAVFILTER_VERSION_MAJOR < 7)
66#endif
64#ifndef FF_API_AVFILTER_OPEN67#ifndef FF_API_AVFILTER_OPEN
65#define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 6)68#define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 6)
66#endif69#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