From af9e622776c9268fd473cc23a0fd6b29f0017f64 Mon Sep 17 00:00:00 2001 From: Marton Balint Date: Sun, 10 May 2020 19:54:51 +0200 Subject: 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 --- libavutil/opt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libavutil/opt.c') 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 { -- cgit v1.2.3