* commit 'e67a87eac814c7805d18c983c43033a8a1bd62af': vf_(no)format: switch to an AVOptions-based system. af_aformat: switch to an AVOptions-based system. Conflicts: doc/filters.texi libavfilter/af_aformat.c
Showing the changes to libavfilter/avfilter.c (1 of 4 files). Show all
Unified · Split
| @@ -654,6 +654,9 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 653 unmodified lines | |||
| 654 | AVDictionaryEntry *e; | 654 | AVDictionaryEntry *e; |
| 655 | int ret=0; | 655 | int ret=0; |
| 656 | int anton_options = | 656 | int anton_options = |
| 657 | !strcmp(filter->filter->name, "aformat") || | ||
| 658 | !strcmp(filter->filter->name, "format") || | ||
| 659 | !strcmp(filter->filter->name, "noformat") || | ||
| 657 | !strcmp(filter->filter->name, "resample") | 660 | !strcmp(filter->filter->name, "resample") |
| 658 | ; | 661 | ; |
| 659 | 662 | ||
| @@ -675,6 +678,33 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 15 unmodified lines | |||
| 675 | ret = av_dict_parse_string(&options, args, "=", ":", 0); | 678 | ret = av_dict_parse_string(&options, args, "=", ":", 0); |
| 676 | if (ret < 0) | 679 | if (ret < 0) |
| 677 | goto fail; | 680 | goto fail; |
| 681 | #if FF_API_OLD_FILTER_OPTS | ||
| 682 | } else if (!strcmp(filter->filter->name, "format") || | ||
| 683 | !strcmp(filter->filter->name, "noformat")) { | ||
| 684 | /* a hack for compatibility with the old syntax | ||
| 685 | * replace colons with |s */ | ||
| 686 | char *copy = av_strdup(args); | ||
| 687 | char *p = copy; | ||
| 688 | |||
| 689 | if (!copy) { | ||
| 690 | ret = AVERROR(ENOMEM); | ||
| 691 | goto fail; | ||
| 692 | } | ||
| 693 | |||
| 694 | if (strchr(copy, ':')) { | ||
| 695 | av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use " | ||
| 696 | "'|' to separate the list items.\n"); | ||
| 697 | } | ||
| 698 | |||
| 699 | while ((p = strchr(p, ':'))) | ||
| 700 | *p++ = '|'; | ||
| 701 | |||
| 702 | ret = process_unnamed_options(filter, &options, copy); | ||
| 703 | av_freep(©); | ||
| 704 | |||
| 705 | if (ret < 0) | ||
| 706 | goto fail; | ||
| 707 | #endif | ||
| 678 | } else { | 708 | } else { |
| 679 | ret = process_unnamed_options(filter, &options, args); | 709 | ret = process_unnamed_options(filter, &options, args); |
| 680 | if (ret < 0) | 710 | if (ret < 0) |