]> git.alsa-project.org Git - alsa-utils.git/commitdiff
amixer: fix display of unreadable control elements
authorClemens Ladisch <clemens@ladisch.de>
Mon, 1 Feb 2010 12:22:39 +0000 (13:22 +0100)
committerClemens Ladisch <clemens@ladisch.de>
Mon, 1 Feb 2010 12:22:39 +0000 (13:22 +0100)
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>
amixer/amixer.c

index 962072133ccdaae8e23772ac1fcbb4d6c85a232a..7b5503560fc8efef99f9ba68081ee1757cee6bef 100644 (file)
@@ -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);