ALSA: pcm: playback silence - remove extra code
authorJaroslav Kysela <perex@perex.cz>
Fri, 5 May 2023 15:52:41 +0000 (17:52 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 5 May 2023 16:23:51 +0000 (18:23 +0200)
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>
Link: https://lore.kernel.org/r/20230505155244.2312199-4-oswald.buddenhagen@gmx.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_lib.c

index 5ddb74a..a183813 100644 (file)
@@ -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;