From patchwork Tue Jan 12 07:57:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 8014661 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BEEE79F2F4 for ; Tue, 12 Jan 2016 07:58:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EEB0A20383 for ; Tue, 12 Jan 2016 07:58:06 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id C3A3A20361 for ; Tue, 12 Jan 2016 07:58:05 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BA8E1265382; Tue, 12 Jan 2016 08:58:04 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D8C30265328; Tue, 12 Jan 2016 08:57:56 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id AFD08265344; Tue, 12 Jan 2016 08:57:55 +0100 (CET) Received: from mail-pf0-f181.google.com (mail-pf0-f181.google.com [209.85.192.181]) by alsa0.perex.cz (Postfix) with ESMTP id 7EBC0265312; Tue, 12 Jan 2016 08:57:48 +0100 (CET) Received: by mail-pf0-f181.google.com with SMTP id q63so60576592pfb.1; Mon, 11 Jan 2016 23:57:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:cc:subject:date; bh=gERw4dNZVgNXrvLfm52NuUkyKS/eaIm7K39P7L6bN0M=; b=VynEARO9C+m9JLxT/R4irTUjDZ8JVuoAFITwSX7ZIN868pUGx8oL055xXA0ECk6ddl dZNGMVpstovsV8SbajbxkzQebdiPJ37sUmQ3cKbMCyySe4VN0T3RkmWzrIEQNwa/sUBP lhUSBTAUpER0SHy2X5Zxr9Y+udw65A8eZn+JuBaA1snVgxnyJx7akIJLzLLvEVYqTQIn 0OaVh/PVDT6weIpH4Yl/PIW30kv3cVkLYrbl3NBLTYGvqYrS9dal4DOGNdT5LxtHNZPb Npm0syy/1F8xfqttyu2R9KIFd0rJi01s29PmSShrd1Ypi3tl1vpzDS1sSXYAxrifluXn cWNg== X-Received: by 10.98.16.72 with SMTP id y69mr32471686pfi.95.1452585467174; Mon, 11 Jan 2016 23:57:47 -0800 (PST) Received: from localhost.localdomain (123202047244.ctinets.com. [123.202.47.244]) by smtp.gmail.com with ESMTPSA id g10sm28146915pfd.49.2016.01.11.23.57.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 23:57:46 -0800 (PST) Message-ID: <5694b1fa.8a41620a.6c971.ffffd9ad@mx.google.com> X-Google-Original-Message-ID: <1452585459-14952-1-git-send-email-me> From: tom.ty89@gmail.com X-Google-Original-From: me To: patch@alsa-project.org Date: Tue, 12 Jan 2016 15:57:39 +0800 X-Mailer: git-send-email 2.7.0 Cc: alsa-devel@alsa-project.org, Tom Yan Subject: [alsa-devel] [PATCH - a52 plugin 1/1] fix reported input channel order X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tom Yan a52 plugin expects the input to be in ALSA order and remaps it to general order when encoding. However it reports that the input it takes should be in general order. This fix should make programs (e.g. mpv) that is aware of channel layout reported by ALSA remap sources appropriately before sending when necessary. It should not cause any regression to programs (e.g. mplayer) that does not check the reported channel layout (hence not affected by the issue) and remaps sources anyway. Signed-off-by: Tom Yan diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c index 4e4c5f7..88529eb 100644 --- a/a52/pcm_a52.c +++ b/a52/pcm_a52.c @@ -663,8 +663,8 @@ static unsigned int chmap4[4] = { }; static unsigned int chmap6[6] = { SND_CHMAP_FL, SND_CHMAP_FR, - SND_CHMAP_FC, SND_CHMAP_LFE, SND_CHMAP_RL, SND_CHMAP_RR, + SND_CHMAP_FC, SND_CHMAP_LFE, }; static snd_pcm_chmap_query_t **a52_query_chmaps(snd_pcm_ioplug_t *io ATTRIBUTE_UNUSED)