mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-07 13:30:07 -05:00
control: Allow cset'ing specific values in the multi-value case
Improve the parser to allow empty elements followed by a comma. Now amixer works like below for setting only the third element. % amixer cset 'IIR1 Band1' ,,200 Reported-and-tested-by: Arun Raghavan <arun@accosted.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
18ce3ec9ca
commit
2fd098b587
1 changed files with 3 additions and 0 deletions
|
|
@ -325,6 +325,8 @@ int snd_ctl_ascii_value_parse(snd_ctl_t *handle,
|
||||||
snd_ctl_elem_value_set_id(dst, myid);
|
snd_ctl_elem_value_set_id(dst, myid);
|
||||||
|
|
||||||
for (idx = 0; idx < count && idx < 128 && ptr && *ptr; idx++) {
|
for (idx = 0; idx < count && idx < 128 && ptr && *ptr; idx++) {
|
||||||
|
if (*ptr == ',')
|
||||||
|
goto skip;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case SND_CTL_ELEM_TYPE_BOOLEAN:
|
case SND_CTL_ELEM_TYPE_BOOLEAN:
|
||||||
tmp = 0;
|
tmp = 0;
|
||||||
|
|
@ -375,6 +377,7 @@ int snd_ctl_ascii_value_parse(snd_ctl_t *handle,
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
skip:
|
||||||
if (!strchr(value, ','))
|
if (!strchr(value, ','))
|
||||||
ptr = value;
|
ptr = value;
|
||||||
else if (*ptr == ',')
|
else if (*ptr == ',')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue