diff mbox series

[FFmpeg-devel,1/2] avfilter: simplify processing child context options

Message ID 20220315085812.13916-1-anton@khirnov.net
State Accepted
Commit a0f04433f4fcca3ccc35cbccd34943bb7333221f
Headers show
Series [FFmpeg-devel,1/2] avfilter: simplify processing child context options | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov March 15, 2022, 8:58 a.m. UTC
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().
---
 libavfilter/avfilter.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 1f37a70179..030f1823ee 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -861,14 +861,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;
             }
         }