]> git.alsa-project.org Git - alsa-utils.git/commitdiff
amixer: actually print all TLVs in a container TLV
authorAnssi Hannula <anssi.hannula@iki.fi>
Mon, 30 Sep 2013 20:46:50 +0000 (23:46 +0300)
committerTakashi Iwai <tiwai@suse.de>
Tue, 1 Oct 2013 10:23:45 +0000 (12:23 +0200)
Due to a wrong indexing of tlv[] decode_tlv() always skips to the end of
the container TLV since the used tlv[1] contains the container TLV size
instead of the intended element size.

This causes, for example, only the first HDMI channel map TLV to be
shown.

Fix the indexing to actually use the element size.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
amixer/amixer.c

index 7727943c8d5c49830e3562f076d32a2c611cde49..b83b0c3564742a0463fa83a72ad45d425f84ed81 100644 (file)
@@ -468,7 +468,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
                                return;
                        }
                        decode_tlv(spaces + 2, tlv + idx, tlv[idx+1] + 8);
-                       idx += 2 + (tlv[1] + sizeof(unsigned int) - 1) / sizeof(unsigned int);
+                       idx += 2 + (tlv[idx+1] + sizeof(unsigned int) - 1) / sizeof(unsigned int);
                }
                break;
        case SND_CTL_TLVT_DB_SCALE: