From: Clemens Ladisch Date: Mon, 1 Feb 2010 12:22:39 +0000 (+0100) Subject: amixer: fix display of unreadable control elements X-Git-Tag: v1.0.23~9 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=cdc496addb28784ae6bc43efc5afa67cba073fde;p=alsa-utils.git 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 --- 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);