mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
ucm: adding the folder of card_long_name when finding verb conf file
The board configuration file and verb conf file are allowed to be in the folder named of card_long_name, so when finding the verb conf file, we need to check if it is in the folder of card_long_name or card_name. Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
23a20cda11
commit
181f8e251b
1 changed files with 8 additions and 2 deletions
|
|
@ -1056,6 +1056,7 @@ static int parse_verb_file(snd_use_case_mgr_t *uc_mgr,
|
|||
char filename[MAX_FILE];
|
||||
char *env = getenv(ALSA_CONFIG_UCM_VAR);
|
||||
int err;
|
||||
char *folder_name;
|
||||
|
||||
/* allocate verb */
|
||||
verb = calloc(1, sizeof(struct use_case_verb));
|
||||
|
|
@ -1082,12 +1083,17 @@ static int parse_verb_file(snd_use_case_mgr_t *uc_mgr,
|
|||
}
|
||||
|
||||
/* open Verb file for reading */
|
||||
if (!strncmp(uc_mgr->conf_file_name, uc_mgr->card_long_name, MAX_CARD_LONG_NAME))
|
||||
folder_name = uc_mgr->card_long_name;
|
||||
else
|
||||
folder_name = uc_mgr->card_name;
|
||||
|
||||
if (env)
|
||||
snprintf(filename, sizeof(filename), "%s/%s/%s",
|
||||
env, uc_mgr->card_name, file);
|
||||
env, folder_name, file);
|
||||
else
|
||||
snprintf(filename, sizeof(filename), "%s/ucm/%s/%s",
|
||||
snd_config_topdir(), uc_mgr->card_name, file);
|
||||
snd_config_topdir(), folder_name, file);
|
||||
filename[sizeof(filename)-1] = '\0';
|
||||
|
||||
err = uc_mgr_config_load(filename, &cfg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue