From: Jaroslav Kysela Date: Thu, 13 May 2021 16:28:20 +0000 (+0200) Subject: ucm: parse LibraryConfig also in the toplevel file X-Git-Tag: v1.2.5~21 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=d9658b75093a4170384bc5108d099d6e983eae81;p=alsa-lib.git ucm: parse LibraryConfig also in the toplevel file Signed-off-by: Jaroslav Kysela --- diff --git a/src/ucm/parser.c b/src/ucm/parser.c index 33754803..2a425da6 100644 --- a/src/ucm/parser.c +++ b/src/ucm/parser.c @@ -2098,7 +2098,7 @@ static int parse_master_file(snd_use_case_mgr_t *uc_mgr, snd_config_t *cfg) if (strcmp(id, "Error") == 0) return error_node(uc_mgr, n); - uc_error("uknown master file field %s", id); + uc_error("unknown master file field %s", id); } return 0; } @@ -2337,7 +2337,17 @@ static int parse_toplevel_config(snd_use_case_mgr_t *uc_mgr, continue; } - uc_error("uknown toplevel field %s", id); + /* alsa-lib configuration */ + if (uc_mgr->conf_format > 3 && strcmp(id, "LibraryConfig") == 0) { + err = parse_libconfig(uc_mgr, n); + if (err < 0) { + uc_error("error: failed to parse LibConfig"); + return err; + } + continue; + } + + uc_error("unknown toplevel field %s", id); } return -ENOENT;