summaryrefslogtreecommitdiff
path: root/amixer
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2010-02-01 13:22:39 +0100
committerClemens Ladisch <clemens@ladisch.de>2010-02-01 13:22:39 +0100
commitcdc496addb28784ae6bc43efc5afa67cba073fde (patch)
treeeedf6049e0aab0ed80ac7d6d5b7f2aa0fb48dcbf /amixer
parent0034b1f83f6e14f89a2fc2b2b02f14fcf0e93b2f (diff)
downloadalsa-utils-cdc496addb28784ae6bc43efc5afa67cba073fde.tar.gz
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>
Diffstat (limited to 'amixer')
-rw-r--r--amixer/amixer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/amixer/amixer.c b/amixer/amixer.c
index 9620721..7b55035 100644
--- a/amixer/amixer.c
+++ b/amixer/amixer.c
@@ -602,6 +602,8 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,
break;
}
if (level & LEVEL_BASIC) {
+ if (!snd_ctl_elem_info_is_readable(info))
+ goto __skip_read;
if ((err = snd_hctl_elem_read(elem, control)) < 0) {
error("Control %s element read error: %s\n", card, snd_strerror(err));
return err;
@@ -638,6 +640,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,
}
}
printf("\n");
+ __skip_read:
if (!snd_ctl_elem_info_is_tlv_readable(info))
goto __skip_tlv;
tlv = malloc(4096);