-#if FF_API_OLD_FILTER_OPTS_ERROR
- if ( !strcmp(filter->filter->name, "format") ||
- !strcmp(filter->filter->name, "noformat") ||
- !strcmp(filter->filter->name, "frei0r") ||
- !strcmp(filter->filter->name, "frei0r_src") ||
- !strcmp(filter->filter->name, "ocv") ||
- !strcmp(filter->filter->name, "pan") ||
- !strcmp(filter->filter->name, "pp") ||
- !strcmp(filter->filter->name, "aevalsrc")) {
- /* 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
- int deprecated = 0;
-
- if (!copy) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
- if (!strcmp(filter->filter->name, "frei0r") ||
- !strcmp(filter->filter->name, "ocv"))
- 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++;
- }
-
- deprecated = strchr(p, ':') != NULL;
-
- if (!strcmp(filter->filter->name, "aevalsrc")) {
- deprecated = 0;
- while ((p = strchr(p, ':')) && p[1] != ':') {
- const char *epos = strchr(p + 1, '=');
- const char *spos = strchr(p + 1, ':');
- const int next_token_is_opt = epos && (!spos || epos < spos);
- if (next_token_is_opt) {
- p++;
- break;
- }
- /* next token does not contain a '=', assume a channel expression */
- deprecated = 1;
- *p++ = '|';
- }
- if (p && *p == ':') { // double sep '::' found
- deprecated = 1;
- memmove(p, p + 1, strlen(p));
- }
- } else
- while ((p = strchr(p, ':')))
- *p++ = '|';
-
- 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);
- }
- av_freep(©);
-
- if (ret < 0)
- goto fail;
- } else
-#endif
- {
- ret = process_options(filter, &options, args);
- if (ret < 0)
- goto fail;
- }