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
487 if (ret < 0)487 if (ret < 0)
488 goto fail;488 goto fail;
489#if FF_API_OLD_FILTER_OPTS489#if FF_API_OLD_FILTER_OPTS
490 } else if (!strcmp(filter->filter->name, "format") ||490 } else if (!strcmp(filter->filter->name, "format") ||
491 !strcmp(filter->filter->name, "noformat")) {491 !strcmp(filter->filter->name, "noformat") ||
492 !strcmp(filter->filter->name, "frei0r") ||
493 !strcmp(filter->filter->name, "frei0r_src")) {
492 /* a hack for compatibility with the old syntax494 /* a hack for compatibility with the old syntax
493 * replace colons with |s */495 * replace colons with |s */
494 char *copy = av_strdup(args);496 char *copy = av_strdup(args);
495 char *p = copy;497 char *p = copy;
498 int nb_leading = 0; // number of leading colons to skip
496 499
497 if (!copy) {500 if (!copy) {
498 ret = AVERROR(ENOMEM);501 ret = AVERROR(ENOMEM);
499 goto fail;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 av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use "520 av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use "
504 "'|' to separate the list items.\n");521 "'|' to separate the list items.\n");
505 }522 }

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