aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/opt.c
diff options
context:
space:
mode:
authorLukasz Marek <lukasz.m.luki2@gmail.com>2014-04-29 23:57:24 +0200
committerLukasz Marek <lukasz.m.luki2@gmail.com>2014-05-02 18:04:05 +0200
commitba52fb11dc6305ec2ded10ad172ebb28e6583038 (patch)
treefcb8182debff800eaa038bdfacecc7857dd261bb /libavutil/opt.c
parentdb4b03146cc3a355b000c4a8444efac3ee5b33f2 (diff)
downloadffmpeg-ba52fb11dc6305ec2ded10ad172ebb28e6583038.tar.gz
lavu/opt: add av_opt_set_dict2() function
Existing av_opt_set_dict doesn't accept flags. It doesn't allow to pass options to nested structs. New function alllows that. Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r--libavutil/opt.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 33ebe52749..199eadbc05 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -1415,7 +1415,7 @@ void av_opt_free(void *obj)
av_freep((uint8_t *)obj + o->offset);
}
-int av_opt_set_dict(void *obj, AVDictionary **options)
+int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags)
{
AVDictionaryEntry *t = NULL;
AVDictionary *tmp = NULL;
@@ -1425,7 +1425,7 @@ int av_opt_set_dict(void *obj, AVDictionary **options)
return 0;
while ((t = av_dict_get(*options, "", t, AV_DICT_IGNORE_SUFFIX))) {
- ret = av_opt_set(obj, t->key, t->value, 0);
+ ret = av_opt_set(obj, t->key, t->value, search_flags);
if (ret == AVERROR_OPTION_NOT_FOUND)
av_dict_set(&tmp, t->key, t->value, 0);
else if (ret < 0) {
@@ -1439,6 +1439,11 @@ int av_opt_set_dict(void *obj, AVDictionary **options)
return ret;
}
+int av_opt_set_dict(void *obj, AVDictionary **options)
+{
+ return av_opt_set_dict2(obj, options, 0);
+}
+
const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
int opt_flags, int search_flags)
{