mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-11 04:27:44 -05:00
ucm: substitute Comment in Transition and Device
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
8d90c4746b
commit
8d26f25ad3
1 changed files with 11 additions and 5 deletions
|
|
@ -410,10 +410,16 @@ static int parse_transition(snd_use_case_mgr_t *uc_mgr,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
INIT_LIST_HEAD(&tseq->transition_list);
|
INIT_LIST_HEAD(&tseq->transition_list);
|
||||||
|
|
||||||
tseq->name = strdup(id);
|
if (uc_mgr->conf_format < 3) {
|
||||||
if (tseq->name == NULL) {
|
tseq->name = strdup(id);
|
||||||
|
if (tseq->name == NULL)
|
||||||
|
err = -ENOMEM;
|
||||||
|
} else {
|
||||||
|
err = uc_mgr_get_substituted_value(uc_mgr, &tseq->name, id);
|
||||||
|
}
|
||||||
|
if (err < 0) {
|
||||||
free(tseq);
|
free(tseq);
|
||||||
return -ENOMEM;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = parse_sequence(uc_mgr, &tseq->transition_list, n);
|
err = parse_sequence(uc_mgr, &tseq->transition_list, n);
|
||||||
|
|
@ -940,7 +946,7 @@ static int parse_modifier(snd_use_case_mgr_t *uc_mgr,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (strcmp(id, "Comment") == 0) {
|
if (strcmp(id, "Comment") == 0) {
|
||||||
err = parse_string(n, &modifier->comment);
|
err = parse_string_substitute3(uc_mgr, n, &modifier->comment);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
uc_error("error: failed to get modifier comment");
|
uc_error("error: failed to get modifier comment");
|
||||||
return err;
|
return err;
|
||||||
|
|
@ -1085,7 +1091,7 @@ static int parse_device(snd_use_case_mgr_t *uc_mgr,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (strcmp(id, "Comment") == 0) {
|
if (strcmp(id, "Comment") == 0) {
|
||||||
err = parse_string(n, &device->comment);
|
err = parse_string_substitute3(uc_mgr, n, &device->comment);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
uc_error("error: failed to get device comment");
|
uc_error("error: failed to get device comment");
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue