From patchwork Fri May 5 07:38:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaroslav Kysela X-Patchwork-Id: 13232229 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D69DCC77B7C for ; Fri, 5 May 2023 07:41:09 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9B2622BCA; Fri, 5 May 2023 09:40:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9B2622BCA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1683272467; bh=R88cO1861f6w+/4ZfPvDViXcrR/ueLQB9Ijq6Z2MgX8=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=mHB3xyTz709Nj0RHKEnuXXuQVDuGzI9vCtkn6jnLaNZwBpxAg+IekllXDa9lctkIo vOP9Nfsk5mkdiZlQGXpNLHu2zcuFldOf9pUAZd5kWeGyjEto1g4baGu4U+suPPbC0K twRklO24HC438SMNGumBwRvfnenv/iFPdVX89yTM= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id B2051F8056F; Fri, 5 May 2023 09:38:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 18598F8056F; Fri, 5 May 2023 09:38:54 +0200 (CEST) Received: from mail1.perex.cz (mail1.perex.cz [77.48.224.245]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 45C97F8055C for ; Fri, 5 May 2023 09:38:52 +0200 (CEST) Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id 9331D11E2; Fri, 5 May 2023 09:38:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz 9331D11E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1683272331; bh=gp37Rx7Hq4VD9UfxfAihkr+ycljvRjXneQqHQ1WMjcs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0E3s/ljK8+3EKtkjiSwUoyHyBt6yPvaHymD9ich9wI1pTzsiAeE7/kncrl46fLvHE m3fWYulkADhQ4gaxAa1uhpcbkx2gSLgeAr2ahMliVbcfYgu6GMq3H5ZTVKFPfcFwfG 8qOtm3wr7H513nOCSLgi4yk0NvVXp5i0pGB4NlPM= Received: from p1gen2.perex-int.cz (unknown [192.168.100.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: perex) by mail1.perex.cz (Perex's E-mail Delivery System) with ESMTPSA; Fri, 5 May 2023 09:38:46 +0200 (CEST) From: Jaroslav Kysela To: ALSA development Subject: [PATCH 4/5] ALSA: pcm: playback silence - remove extra code Date: Fri, 5 May 2023 09:38:12 +0200 Message-Id: <20230505073813.1219175-5-perex@perex.cz> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505073813.1219175-1-perex@perex.cz> References: <20230505073813.1219175-1-perex@perex.cz> MIME-Version: 1.0 Message-ID-Hash: QKLVIBRSMTCOD2URKGP75AVC55VQCP7I X-Message-ID-Hash: QKLVIBRSMTCOD2URKGP75AVC55VQCP7I X-MailFrom: perex@perex.cz X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Takashi Iwai , Oswald Buddenhagen , Jeff Chua X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The removed condition handles de facto only one situation where runtime->silence_filled variable is equal to runtime->buffer_size, because this variable cannot go over the buffer size. This case is catched also with the next condition for the noise distance and required threshold comparison. Suggested-by: Oswald Buddenhagen Signed-off-by: Jaroslav Kysela --- sound/core/pcm_lib.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index cfdb4aa5f6fa..952f0d807124 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -61,8 +61,6 @@ void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_ufram runtime->silence_filled = 0; runtime->silence_start = appl_ptr; } - if (runtime->silence_filled >= runtime->buffer_size) - return; /* initialization outside pointer updates */ if (new_hw_ptr == ULONG_MAX) new_hw_ptr = runtime->status->hw_ptr;