* commit '5aa1a668cfae7f617e1a06efad20f87283badd8a': vf_frei0r: switch to an AVOptions-based system. Conflicts: doc/filters.texi libavfilter/vf_frei0r.c
Showing the changes to libavfilter/avfilter.c (1 of 3 files). Show all
Unified · Split
| @@ -667,6 +667,8 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 666 unmodified lines | ||
| 667 | 667 | !strcmp(filter->filter->name, "fade" ) || |
| 668 | 668 | !strcmp(filter->filter->name, "fieldorder") || |
| 669 | 669 | !strcmp(filter->filter->name, "fps" ) || |
| 670 | + !strcmp(filter->filter->name, "frei0r" ) || | |
| 671 | + !strcmp(filter->filter->name, "frei0r_src") || | |
| 670 | 672 | !strcmp(filter->filter->name, "format") || |
| 671 | 673 | !strcmp(filter->filter->name, "noformat") || |
| 672 | 674 | !strcmp(filter->filter->name, "resample") |
| @@ -691,19 +693,36 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 18 unmodified lines | ||
| 691 | 693 | if (ret < 0) |
| 692 | 694 | goto fail; |
| 693 | 695 | #if FF_API_OLD_FILTER_OPTS |
| 694 | − } else if (!strcmp(filter->filter->name, "format") || | |
| 695 | − !strcmp(filter->filter->name, "noformat")) { | |
| 696 | + } else if (!strcmp(filter->filter->name, "format") || | |
| 697 | + !strcmp(filter->filter->name, "noformat") || | |
| 698 | + !strcmp(filter->filter->name, "frei0r") || | |
| 699 | + !strcmp(filter->filter->name, "frei0r_src")) { | |
| 696 | 700 | /* a hack for compatibility with the old syntax |
| 697 | 701 | * replace colons with |s */ |
| 698 | 702 | char *copy = av_strdup(args); |
| 699 | 703 | char *p = copy; |
| 704 | + int nb_leading = 0; // number of leading colons to skip | |
| 700 | 705 | |
| 701 | 706 | if (!copy) { |
| 702 | 707 | ret = AVERROR(ENOMEM); |
| 703 | 708 | goto fail; |
| 704 | 709 | } |
| 705 | 710 | |
| 706 | − if (strchr(copy, ':')) { | |
| 711 | + if (!strcmp(filter->filter->name, "frei0r")) | |
| 712 | + nb_leading = 1; | |
| 713 | + else if (!strcmp(filter->filter->name, "frei0r_src")) | |
| 714 | + nb_leading = 3; | |
| 715 | + | |
| 716 | + while (nb_leading--) { | |
| 717 | + p = strchr(p, ':'); | |
| 718 | + if (!p) { | |
| 719 | + p = copy + strlen(copy); | |
| 720 | + break; | |
| 721 | + } | |
| 722 | + p++; | |
| 723 | + } | |
| 724 | + | |
| 725 | + if (strchr(p, ':')) { | |
| 707 | 726 | av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use " |
| 708 | 727 | "'|' to separate the list items.\n"); |
| 709 | 728 | } |