diff options
author | Lukasz Marek <lukasz.m.luki2@gmail.com> | 2014-04-29 23:57:24 +0200 |
---|---|---|
committer | Lukasz Marek <lukasz.m.luki2@gmail.com> | 2014-05-02 18:04:05 +0200 |
commit | ba52fb11dc6305ec2ded10ad172ebb28e6583038 (patch) | |
tree | fcb8182debff800eaa038bdfacecc7857dd261bb /libavutil/opt.c | |
parent | db4b03146cc3a355b000c4a8444efac3ee5b33f2 (diff) | |
download | ffmpeg-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.c | 9 |
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) { |