mirror of https://github.com/ericonr/sndio.git
Don't add server.device knob if there's only one audio device
This commit is contained in:
parent
e79f8b5c2f
commit
c888f2750b
15
sndiod/dev.c
15
sndiod/dev.c
|
@ -1236,12 +1236,15 @@ dev_open(struct dev *d)
|
|||
NULL, -1, 127, d->slot[i].vol);
|
||||
}
|
||||
|
||||
for (a = d->alt_list; a != NULL; a = a->next) {
|
||||
snprintf(name, sizeof(name), "%d", a->idx);
|
||||
dev_addctl(d, "", CTL_SEL,
|
||||
CTLADDR_ALT_SEL + a->idx,
|
||||
"server", -1, "device",
|
||||
name, -1, 1, a->idx == d->alt_num);
|
||||
/* if there are multiple alt devs, add server.device knob */
|
||||
if (d->alt_list->next != NULL) {
|
||||
for (a = d->alt_list; a != NULL; a = a->next) {
|
||||
snprintf(name, sizeof(name), "%d", a->idx);
|
||||
dev_addctl(d, "", CTL_SEL,
|
||||
CTLADDR_ALT_SEL + a->idx,
|
||||
"server", -1, "device",
|
||||
name, -1, 1, a->idx == d->alt_num);
|
||||
}
|
||||
}
|
||||
|
||||
d->pstate = DEV_INIT;
|
||||
|
|
Loading…
Reference in New Issue