History

avfilter: handle duplicates in the options string

Use the same logic as fftools/cmdutils - when a flag-type option starts with [+-], append it to the existing value.

Anton Khirnov committed 4 years ago

Commit 1b7ecb31 parent a0f04431 file · +6 −2Browse files

Unified · Split

libavfilter/avfilter.c+6−2
@@ -862,13 +862,17 @@ static int process_options(AVFilterContext *ctx, AVDictionary **options, · 861 unmodified lines
862862 return ret;
863863 }
864864 } else {
865− av_dict_set(options, key, value, 0);
866− if (!av_opt_find(ctx->priv, key, NULL, 0, AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {
865+ o = av_opt_find(ctx->priv, key, NULL, 0,
866+ AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
867+ if (!o) {
867868 av_log(ctx, AV_LOG_ERROR, "Option '%s' not found\n", key);
868869 av_free(value);
869870 av_free(parsed_key);
870871 return AVERROR_OPTION_NOT_FOUND;
871872 }
873+ av_dict_set(options, key, value,
874+ (o->type == AV_OPT_TYPE_FLAGS &&
875+ (value[0] == '-' || value[0] == '+')) ? AV_DICT_APPEND : 0);
872876 }
873877
874878 av_free(value);

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