Showing the changes to libavfilter/avfilter.c (1 of 3 files). Show all
Unified · Split
| @@ -487,19 +487,36 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 486 unmodified lines | ||
| 487 | 487 | if (ret < 0) |
| 488 | 488 | goto fail; |
| 489 | 489 | #if FF_API_OLD_FILTER_OPTS |
| 490 | − } else if (!strcmp(filter->filter->name, "format") || | |
| 491 | − !strcmp(filter->filter->name, "noformat")) { | |
| 490 | + } else if (!strcmp(filter->filter->name, "format") || | |
| 491 | + !strcmp(filter->filter->name, "noformat") || | |
| 492 | + !strcmp(filter->filter->name, "frei0r") || | |
| 493 | + !strcmp(filter->filter->name, "frei0r_src")) { | |
| 492 | 494 | /* a hack for compatibility with the old syntax |
| 493 | 495 | * replace colons with |s */ |
| 494 | 496 | char *copy = av_strdup(args); |
| 495 | 497 | char *p = copy; |
| 498 | + int nb_leading = 0; // number of leading colons to skip | |
| 496 | 499 | |
| 497 | 500 | if (!copy) { |
| 498 | 501 | ret = AVERROR(ENOMEM); |
| 499 | 502 | goto fail; |
| 500 | 503 | } |
| 501 | 504 | |
| 502 | − if (strchr(copy, ':')) { | |
| 505 | + if (!strcmp(filter->filter->name, "frei0r")) | |
| 506 | + nb_leading = 1; | |
| 507 | + else if (!strcmp(filter->filter->name, "frei0r_src")) | |
| 508 | + nb_leading = 3; | |
| 509 | + | |
| 510 | + while (nb_leading--) { | |
| 511 | + p = strchr(p, ':'); | |
| 512 | + if (!p) { | |
| 513 | + p = copy + strlen(copy); | |
| 514 | + break; | |
| 515 | + } | |
| 516 | + p++; | |
| 517 | + } | |
| 518 | + | |
| 519 | + if (strchr(p, ':')) { | |
| 503 | 520 | av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use " |
| 504 | 521 | "'|' to separate the list items.\n"); |
| 505 | 522 | } |