Skip to content
/ FFmpeg Public
forked from FFmpeg/FFmpeg

Commit

Permalink
avfilter: simplify processing child context options
Browse files Browse the repository at this point in the history
THe call to av_opt_set() is redundant, since the option is written in
the options dict, which is later passed to avfilter_init_dict().
  • Loading branch information
elenril committed Mar 22, 2022
1 parent 303ddab commit a0f0443
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions libavfilter/avfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,14 +863,11 @@ static int process_options(AVFilterContext *ctx, AVDictionary **options,
}
} else {
av_dict_set(options, key, value, 0);
if ((ret = av_opt_set(ctx->priv, key, value, AV_OPT_SEARCH_CHILDREN)) < 0) {
if (!av_opt_find(ctx->priv, key, NULL, 0, AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {
if (ret == AVERROR_OPTION_NOT_FOUND)
av_log(ctx, AV_LOG_ERROR, "Option '%s' not found\n", key);
av_free(value);
av_free(parsed_key);
return ret;
}
if (!av_opt_find(ctx->priv, key, NULL, 0, AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {
av_log(ctx, AV_LOG_ERROR, "Option '%s' not found\n", key);
av_free(value);
av_free(parsed_key);
return AVERROR_OPTION_NOT_FOUND;
}
}

Expand Down

0 comments on commit a0f0443

Please sign in to comment.