From patchwork Wed Feb 26 13:32:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Baert X-Patchwork-Id: 3724111 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C4C59BF13A for ; Wed, 26 Feb 2014 13:33:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E78D62016C for ; Wed, 26 Feb 2014 13:33:16 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B6EE02013D for ; Wed, 26 Feb 2014 13:33:15 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id CB6F22656ED; Wed, 26 Feb 2014 14:33:14 +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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, NO_DNS_FOR_FROM,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 75B072655A0; Wed, 26 Feb 2014 14:33:04 +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 926FE2655A0; Wed, 26 Feb 2014 14:33:03 +0100 (CET) Received: from blu0-omc3-s24.blu0.hotmail.com (blu0-omc3-s24.blu0.hotmail.com [65.55.116.99]) by alsa0.perex.cz (Postfix) with ESMTP id 539A92656B0 for ; Wed, 26 Feb 2014 14:32:56 +0100 (CET) Received: from BLU0-SMTP175 ([65.55.116.73]) by blu0-omc3-s24.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 26 Feb 2014 05:32:55 -0800 X-TMN: [EY4UWUvuGgzXoWOYNrv4jyKefsIgxhoB] X-Originating-Email: [maarten-baert@hotmail.com] Message-ID: Received: from [192.168.1.106] ([87.64.163.82]) by BLU0-SMTP175.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 26 Feb 2014 05:32:53 -0800 Date: Wed, 26 Feb 2014 14:32:51 +0100 From: Maarten Baert User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: alsa-devel@alsa-project.org References: In-Reply-To: X-Enigmail-Version: 1.6 X-OriginalArrivalTime: 26 Feb 2014 13:32:53.0497 (UTC) FILETIME=[4059C690:01CF32F7] Subject: Re: [alsa-devel] [PATCH] Bugfix: Fix resampling when client and slave both use format float 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On 26/02/14 08:28, Takashi Iwai wrote: > It's not applicable via git am. Please resubmit with the right format > (that is cleanly applied via git am). Sorry, this one should work. From 3a576686760ec6bb76892443e3c3c9ed2657bf93 Mon Sep 17 00:00:00 2001 From: Maarten Baert Date: Wed, 26 Feb 2014 14:23:45 +0100 Subject: [PATCH] snd_pcm_plug_change_format: Insert linear-to-float conversion when rate or channel count is incorrect. This fixes a bug where snd_pcm_plug_insert_plugins fails when both client and slave use format float, but the rate or channel count does not match. I also removed some redundant code. Signed-off-by: Maarten Baert --- src/pcm/pcm_plug.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c index fa84eaa..ede9c15 100644 --- a/src/pcm/pcm_plug.c +++ b/src/pcm/pcm_plug.c @@ -522,15 +522,13 @@ static int snd_pcm_plug_change_format(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm_p } #ifdef BUILD_PCM_PLUGIN_LFLOAT } else if (snd_pcm_format_float(slv->format)) { - /* Conversion is done in another plugin */ - if (clt->format == slv->format && - clt->rate == slv->rate && - clt->channels == slv->channels) - return 0; - cfmt = clt->format; - if (snd_pcm_format_linear(clt->format)) + if (snd_pcm_format_linear(clt->format)) { + cfmt = clt->format; f = snd_pcm_lfloat_open; - else + } else if (clt->rate != slv->rate || clt->channels != slv->channels) { + cfmt = SND_PCM_FORMAT_S16; + f = snd_pcm_lfloat_open; + } else return -EINVAL; #endif #ifdef BUILD_PCM_NONLINEAR -- 1.9.0