summaryrefslogtreecommitdiff
path: root/libavutil/opt.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2020-05-10 19:54:51 +0200
committerMarton Balint <cus@passwd.hu>2020-05-22 22:16:52 +0200
commitaf9e622776c9268fd473cc23a0fd6b29f0017f64 (patch)
tree05e06f184d51dbca9a73ffd88def10bbb03920a1 /libavutil/opt.c
parent638b5d51cf65b384e8632e650056ed0e62b16884 (diff)
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.c3
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 {