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

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/avfilter.c+6−2
@@ -862,13 +862,17 @@ static int process_options(AVFilterContext *ctx, AVDictionary **options, · 861 unmodified lines
862 return ret;862 return ret;
863 }863 }
864 } else {864 } else {
865 av_dict_set(options, key, value, 0);865 o = av_opt_find(ctx->priv, key, NULL, 0,
866 if (!av_opt_find(ctx->priv, key, NULL, 0, AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {866 AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
867 if (!o) {
867 av_log(ctx, AV_LOG_ERROR, "Option '%s' not found\n", key);868 av_log(ctx, AV_LOG_ERROR, "Option '%s' not found\n", key);
868 av_free(value);869 av_free(value);
869 av_free(parsed_key);870 av_free(parsed_key);
870 return AVERROR_OPTION_NOT_FOUND;871 return AVERROR_OPTION_NOT_FOUND;
871 }872 }
873 av_dict_set(options, key, value,
874 (o->type == AV_OPT_TYPE_FLAGS &&
875 (value[0] == '-' || value[0] == '+')) ? AV_DICT_APPEND : 0);
872 }876 }
873 877
874 av_free(value);878 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