Browse code

avoptions: Fix av_opt_flag_is_set

With the changes in 3b3ea34655db02d9cd9ea1a4122e920a7fdec602,
"Remove all uses of deprecated AVOptions API", av_opt_flag_is_set
was broken, since it now uses av_opt_find, which doesn't return
named constants unless a unit to look for the constant in is given.

This broke enabling LATM encapsulated AAC output in RTP.

Signed-off-by: Martin Storsjö <martin@martin.st>

Martin Storsjö authored on 2011/10/18 02:50:02
Showing 1 changed files
... ...
@@ -501,7 +501,8 @@ int av_opt_get_q(void *obj, const char *name, int search_flags, AVRational *out_
501 501
 int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name)
502 502
 {
503 503
     const AVOption *field = av_opt_find(obj, field_name, NULL, 0, 0);
504
-    const AVOption *flag  = av_opt_find(obj, flag_name,  NULL, 0, 0);
504
+    const AVOption *flag  = av_opt_find(obj, flag_name,
505
+                                        field ? field->unit : NULL, 0, 0);
505 506
     int64_t res;
506 507
 
507 508
     if (!field || !flag || flag->type != AV_OPT_TYPE_CONST ||