History

Merge commit 'e67a87eac814c7805d18c983c43033a8a1bd62af'

* 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

Michael Niedermayer committed 13 years ago

Commit 2a2a6432 parents 4513158 e67a87e4 files · +95 −33Browse files

Showing the changes to libavfilter/avfilter.c (1 of 4 files). Show all

Unified · Split

libavfilter/avfilter.c+30−0
@@ -654,6 +654,9 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 653 unmodified lines
654654 AVDictionaryEntry *e;
655655 int ret=0;
656656 int anton_options =
657+ !strcmp(filter->filter->name, "aformat") ||
658+ !strcmp(filter->filter->name, "format") ||
659+ !strcmp(filter->filter->name, "noformat") ||
657660 !strcmp(filter->filter->name, "resample")
658661 ;
659662
@@ -675,6 +678,33 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 15 unmodified lines
675678 ret = av_dict_parse_string(&options, args, "=", ":", 0);
676679 if (ret < 0)
677680 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(&copy);
704+
705+ if (ret < 0)
706+ goto fail;
707+#endif
678708 } else {
679709 ret = process_unnamed_options(filter, &options, args);
680710 if (ret < 0)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t