Skip to content

Commit

Permalink
ALSA: pcm: playback silence - remove extra code
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
Signed-off-by: Oswald Buddenhagen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
perexg authored and tiwai committed May 5, 2023
1 parent 781b4da commit 190cb66
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions sound/core/pcm_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 190cb66

Please sign in to comment.