aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-11 02:54:22 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-04-03 19:14:12 +0200
commitc96d0a0b850f7068cb1de2206dae02bf44514e57 (patch)
tree7e1a8e32b54c2ed172a219478d49973843a140b1
parentabcb4b44f5d141b26f1b3104ae1c6dfdac33786d (diff)
downloadffmpeg-c96d0a0b850f7068cb1de2206dae02bf44514e57.tar.gz
avfilter/avfilter: Use AV_DICT_DONT_STRDUP_(KEY|VAL) when possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavfilter/avfilter.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 856862a393..508fe1b26b 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -844,6 +844,7 @@ int ff_filter_opt_parse(void *logctx, const AVClass *priv_class,
while (*args) {
const char *shorthand = NULL;
+ int additional_flags = 0;
if (priv_class)
o = av_opt_next(&priv_class, o);
@@ -869,7 +870,7 @@ int ff_filter_opt_parse(void *logctx, const AVClass *priv_class,
args++;
if (parsed_key) {
key = parsed_key;
-
+ additional_flags = AV_DICT_DONT_STRDUP_KEY;
/* discard all remaining shorthand */
if (priv_class)
while ((o = av_opt_next(&priv_class, o)));
@@ -879,10 +880,8 @@ int ff_filter_opt_parse(void *logctx, const AVClass *priv_class,
av_log(logctx, AV_LOG_DEBUG, "Setting '%s' to value '%s'\n", key, value);
- av_dict_set(options, key, value, AV_DICT_MULTIKEY);
-
- av_free(value);
- av_free(parsed_key);
+ av_dict_set(options, key, value,
+ additional_flags | AV_DICT_DONT_STRDUP_VAL | AV_DICT_MULTIKEY);
}
return 0;