diff options
author | Marton Balint <cus@passwd.hu> | 2020-05-10 19:54:51 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2020-05-22 22:16:52 +0200 |
commit | af9e622776c9268fd473cc23a0fd6b29f0017f64 (patch) | |
tree | 05e06f184d51dbca9a73ffd88def10bbb03920a1 /libavutil/opt.c | |
parent | 638b5d51cf65b384e8632e650056ed0e62b16884 (diff) | |
download | ffmpeg-af9e622776c9268fd473cc23a0fd6b29f0017f64.tar.gz |
avutil/opt: add AV_OPT_FLAG_CHILD_CONSTS
This will be used for AVCodecContext->profile. By specifying constants in the
encoders we won't have to use the common AVCodecContext options table and
different encoders can use the same profile name even with different values.
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r-- | libavutil/opt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index b792dec01c..423313bce2 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -256,11 +256,12 @@ static int set_string_number(void *obj, void *target_obj, const AVOption *o, con } { - const AVOption *o_named = av_opt_find(target_obj, i ? buf : val, o->unit, 0, 0); int res; int ci = 0; double const_values[64]; const char * const_names[64]; + int search_flags = (o->flags & AV_OPT_FLAG_CHILD_CONSTS) ? AV_OPT_SEARCH_CHILDREN : 0; + const AVOption *o_named = av_opt_find(target_obj, i ? buf : val, o->unit, 0, search_flags); if (o_named && o_named->type == AV_OPT_TYPE_CONST) d = DEFAULT_NUMVAL(o_named); else { |