aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/core/pcm_lib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index c58ec67d1cbf..eeba2f060955 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -56,9 +56,8 @@ void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_ufram
56 runtime->silence_filled = 0; 56 runtime->silence_filled = 0;
57 runtime->silence_start = runtime->control->appl_ptr; 57 runtime->silence_start = runtime->control->appl_ptr;
58 } 58 }
59 if (runtime->silence_filled == runtime->buffer_size) 59 if (runtime->silence_filled >= runtime->buffer_size)
60 return; 60 return;
61 snd_assert(runtime->silence_filled <= runtime->buffer_size, return);
62 noise_dist = snd_pcm_playback_hw_avail(runtime) + runtime->silence_filled; 61 noise_dist = snd_pcm_playback_hw_avail(runtime) + runtime->silence_filled;
63 if (noise_dist >= (snd_pcm_sframes_t) runtime->silence_threshold) 62 if (noise_dist >= (snd_pcm_sframes_t) runtime->silence_threshold)
64 return; 63 return;
@@ -2006,8 +2005,8 @@ void snd_pcm_tick_prepare(struct snd_pcm_substream *substream)
2006 runtime->silence_filled < runtime->buffer_size) { 2005 runtime->silence_filled < runtime->buffer_size) {
2007 snd_pcm_sframes_t noise_dist; 2006 snd_pcm_sframes_t noise_dist;
2008 noise_dist = snd_pcm_playback_hw_avail(runtime) + runtime->silence_filled; 2007 noise_dist = snd_pcm_playback_hw_avail(runtime) + runtime->silence_filled;
2009 snd_assert(noise_dist <= (snd_pcm_sframes_t)runtime->silence_threshold, ); 2008 if (noise_dist > (snd_pcm_sframes_t)runtime->silence_threshold)
2010 frames = noise_dist - runtime->silence_threshold; 2009 frames = noise_dist - runtime->silence_threshold;
2011 } 2010 }
2012 avail = snd_pcm_playback_avail(runtime); 2011 avail = snd_pcm_playback_avail(runtime);
2013 } else { 2012 } else {