aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-01-06 19:13:13 +0100
committerAnton Khirnov <anton@khirnov.net>2023-01-10 11:52:02 +0100
commitbd7c07c26a8196ef5c29bf50a2a6340e814162a1 (patch)
tree174f6140013f928cbcf2e41a5aa6fdd7d5629dc1 /libavfilter/avfilter.c
parenta7b1b4bc2324ceda830b273552014805192f574a (diff)
downloadffmpeg-bd7c07c26a8196ef5c29bf50a2a6340e814162a1.tar.gz
lavfi/avfilter: avoid a redundant av_opt_set_dict2() call
Current code first sets AVFilterContext-level options, then aplies the leftover on the filter's private data. This is unnecessary, applying the options to AVFilterContext with the AV_OPT_SEARCH_CHILDREN flag accomplishes the same effect.
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index e5dd0cfdb0..689c91891e 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -887,7 +887,7 @@ int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options)
{
int ret = 0;
- ret = av_opt_set_dict(ctx, options);
+ ret = av_opt_set_dict2(ctx, options, AV_OPT_SEARCH_CHILDREN);
if (ret < 0) {
av_log(ctx, AV_LOG_ERROR, "Error applying generic filter options.\n");
return ret;
@@ -902,14 +902,6 @@ int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options)
ctx->thread_type = 0;
}
- if (ctx->filter->priv_class) {
- ret = av_opt_set_dict2(ctx->priv, options, AV_OPT_SEARCH_CHILDREN);
- if (ret < 0) {
- av_log(ctx, AV_LOG_ERROR, "Error applying options to the filter.\n");
- return ret;
- }
- }
-
if (ctx->filter->init)
ret = ctx->filter->init(ctx);
if (ret < 0)