]> git.alsa-project.org Git - alsa-lib.git/commitdiff
ucm: parse LibraryConfig also in the toplevel file
authorJaroslav Kysela <perex@perex.cz>
Thu, 13 May 2021 16:28:20 +0000 (18:28 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 13 May 2021 16:28:20 +0000 (18:28 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/ucm/parser.c

index 337548033eeb510ea7beabfa0c8474a4f8951c87..2a425da6de87bc98bfb32fe6f88f15739427aa77 100644 (file)
@@ -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;