From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anssi Hannula Subject: [PATCH] amixer: fix indentation when printing container TLV contents Date: Tue, 1 Oct 2013 23:46:53 +0300 Message-ID: <1380660413-22755-1-git-send-email-anssi.hannula@iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sinikuusama.dnainternet.net (sinikuusama.dnainternet.net [83.102.40.134]) by alsa0.perex.cz (Postfix) with ESMTP id 5F1C5261ABF for ; Tue, 1 Oct 2013 22:47:00 +0200 (CEST) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Takashi Iwai Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org decode_tlv() adds indentation in the beginning, with the expectation that the TLV will be printed on the line afterwards in a switch-case. However, in the case of a container TLV the switch-case simply adds another level of indentation and calls decode_tlv() for the inner TLVs. This causes the first inner TLV to be printed with too much indentation and double '|'. Fix that by printing "container" and a newline for container TLVs, so that the result is as follows: : values=0,0,0,0,0,0,0,0 | container | chmap-variable=FL,FR | chmap-variable=FL,FR,LFE | chmap-variable=FL,FR,FC Signed-off-by: Anssi Hannula --- amixer/amixer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/amixer/amixer.c b/amixer/amixer.c index b83b0c3..cf82892 100644 --- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -460,6 +460,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_ } switch (type) { case SND_CTL_TLVT_CONTAINER: + printf("container\n"); size += sizeof(unsigned int) -1; size /= sizeof(unsigned int); while (idx < size) { -- 1.8.1.5