summaryrefslogtreecommitdiff
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-02-25 21:21:29 +0100
committerAnton Khirnov <anton@khirnov.net>2013-04-09 19:04:28 +0200
commit5aa1a668cfae7f617e1a06efad20f87283badd8a (patch)
treef417c422ce9c8f905676f521e2feb7416230c4bb /libavfilter/avfilter.c
parentf13ab29925883b4245da4129694af3af378d67be (diff)
vf_frei0r: switch to an AVOptions-based system.
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index e5a7f13464..29b0583023 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -487,19 +487,36 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
if (ret < 0)
goto fail;
#if FF_API_OLD_FILTER_OPTS
- } else if (!strcmp(filter->filter->name, "format") ||
- !strcmp(filter->filter->name, "noformat")) {
+ } else if (!strcmp(filter->filter->name, "format") ||
+ !strcmp(filter->filter->name, "noformat") ||
+ !strcmp(filter->filter->name, "frei0r") ||
+ !strcmp(filter->filter->name, "frei0r_src")) {
/* a hack for compatibility with the old syntax
* replace colons with |s */
char *copy = av_strdup(args);
char *p = copy;
+ int nb_leading = 0; // number of leading colons to skip
if (!copy) {
ret = AVERROR(ENOMEM);
goto fail;
}
- if (strchr(copy, ':')) {
+ if (!strcmp(filter->filter->name, "frei0r"))
+ nb_leading = 1;
+ else if (!strcmp(filter->filter->name, "frei0r_src"))
+ nb_leading = 3;
+
+ while (nb_leading--) {
+ p = strchr(p, ':');
+ if (!p) {
+ p = copy + strlen(copy);
+ break;
+ }
+ p++;
+ }
+
+ if (strchr(p, ':')) {
av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use "
"'|' to separate the list items.\n");
}