mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-09 17:45:41 +01:00
amixer: fix display of unreadable control elements
When an element is marked as not readble, do not try to read it and then complain about the error, but just ignore it. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
This commit is contained in:
parent
0034b1f83f
commit
cdc496addb
1 changed files with 3 additions and 0 deletions
|
@ -602,6 +602,8 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (level & LEVEL_BASIC) {
|
if (level & LEVEL_BASIC) {
|
||||||
|
if (!snd_ctl_elem_info_is_readable(info))
|
||||||
|
goto __skip_read;
|
||||||
if ((err = snd_hctl_elem_read(elem, control)) < 0) {
|
if ((err = snd_hctl_elem_read(elem, control)) < 0) {
|
||||||
error("Control %s element read error: %s\n", card, snd_strerror(err));
|
error("Control %s element read error: %s\n", card, snd_strerror(err));
|
||||||
return err;
|
return err;
|
||||||
|
@ -638,6 +640,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
__skip_read:
|
||||||
if (!snd_ctl_elem_info_is_tlv_readable(info))
|
if (!snd_ctl_elem_info_is_tlv_readable(info))
|
||||||
goto __skip_tlv;
|
goto __skip_tlv;
|
||||||
tlv = malloc(4096);
|
tlv = malloc(4096);
|
||||||
|
|
Loading…
Reference in a new issue