[FFmpeg-cvslog] lavfi/avfilter: simplify process_options()

Anton Khirnov git at videolan.org
Tue Jan 10 12:58:22 EET 2023


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Jan  7 13:36:15 2023 +0100| [d234b4b193e017411e179c7a1d0521a6fa6dbc8d] | committer: Anton Khirnov

lavfi/avfilter: simplify process_options()

This function currently treats AVFilterContext options and
filter-private options differently: the former are immediately applied,
while the latter are stored in a dictionary to be applied later.

There is no good reason for having two branches - storing all options in
the dictionary is simpler and achieves the same effect (since it is
later applied with av_opt_set_dict()).

This will also be useful in future commits.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d234b4b193e017411e179c7a1d0521a6fa6dbc8d
---

 libavfilter/avfilter.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 278d5868de..43dfb11bdb 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -842,16 +842,7 @@ static int process_options(AVFilterContext *ctx, AVDictionary **options,
 
         av_log(ctx, AV_LOG_DEBUG, "Setting '%s' to value '%s'\n", key, value);
 
-        if (av_opt_find(ctx, key, NULL, 0, 0)) {
-            ret = av_opt_set(ctx, key, value, 0);
-            if (ret < 0) {
-                av_free(value);
-                av_free(parsed_key);
-                return ret;
-            }
-        } else {
-            av_dict_set(options, key, value, AV_DICT_MULTIKEY);
-        }
+        av_dict_set(options, key, value, AV_DICT_MULTIKEY);
 
         av_free(value);
         av_free(parsed_key);



More information about the ffmpeg-cvslog mailing list