diff mbox series

[4/7] ALSA: pcm: playback silence - remove extra code

Message ID 20230505103140.2285622-4-oswald.buddenhagen@gmx.de
State New
Headers show
Series [1/7] ALSA: pcm: Revert "ALSA: pcm: rewrite snd_pcm_playback_silence()" | expand

Commit Message

Oswald Buddenhagen May 5, 2023, 10:31 a.m. UTC
From: Jaroslav Kysela <perex@perex.cz>

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
implicitly caught by the required comparison of the noise distance
with the threshold.

Suggested-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
---
v2:
- improved language of commit message
---
 sound/core/pcm_lib.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 5ddb74a12030..a1838130c830 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;