History

vf_frei0r: switch to an AVOptions-based system.

Anton Khirnov committed 13 years ago

Commit 5aa1a661 parent f13ab293 files · +108 −53Browse files

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

Unified · Split

libavfilter/avfilter.c+20−3
@@ -487,19 +487,36 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 486 unmodified lines
487487 if (ret < 0)
488488 goto fail;
489489 #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")) {
492494 /* a hack for compatibility with the old syntax
493495 * replace colons with |s */
494496 char *copy = av_strdup(args);
495497 char *p = copy;
498+ int nb_leading = 0; // number of leading colons to skip
496499
497500 if (!copy) {
498501 ret = AVERROR(ENOMEM);
499502 goto fail;
500503 }
501504
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, ':')) {
503520 av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use "
504521 "'|' to separate the list items.\n");
505522 }

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