parser: only recurse into CHOICE when 1 value

Only try to collect the CHOICE value when there is only 1 value.
This makes it possible to parse the complete choice as a SPA_Pod.
This commit is contained in:
Wim Taymans 2019-12-09 12:23:24 +01:00
parent 6204c95ee3
commit 181c2de2ee

View file

@ -484,7 +484,8 @@ static inline int spa_pod_parser_getv(struct spa_pod_parser *parser, va_list arg
}
SPA_POD_PARSER_SKIP(*format, args);
} else {
if (pod->type == SPA_TYPE_Choice && *format != 'V')
if (pod->type == SPA_TYPE_Choice && *format != 'V' &&
SPA_POD_CHOICE_TYPE(pod) == SPA_CHOICE_None)
pod = SPA_POD_CHOICE_CHILD(pod);
SPA_POD_PARSER_COLLECT(pod, *format, args);