aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/core/pcm_lib.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 0bb142a28539..b336797be4fc 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -79,19 +79,17 @@ void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_ufram
79 runtime->silence_filled -= frames; 79 runtime->silence_filled -= frames;
80 if ((snd_pcm_sframes_t)runtime->silence_filled < 0) { 80 if ((snd_pcm_sframes_t)runtime->silence_filled < 0) {
81 runtime->silence_filled = 0; 81 runtime->silence_filled = 0;
82 runtime->silence_start = (ofs + frames) - runtime->buffer_size; 82 runtime->silence_start = new_hw_ptr;
83 } else { 83 } else {
84 runtime->silence_start = ofs - runtime->silence_filled; 84 runtime->silence_start = ofs;
85 } 85 }
86 if ((snd_pcm_sframes_t)runtime->silence_start < 0)
87 runtime->silence_start += runtime->boundary;
88 } 86 }
89 frames = runtime->buffer_size - runtime->silence_filled; 87 frames = runtime->buffer_size - runtime->silence_filled;
90 } 88 }
91 snd_assert(frames <= runtime->buffer_size, return); 89 snd_assert(frames <= runtime->buffer_size, return);
92 if (frames == 0) 90 if (frames == 0)
93 return; 91 return;
94 ofs = (runtime->silence_start + runtime->silence_filled) % runtime->buffer_size; 92 ofs = runtime->silence_start % runtime->buffer_size;
95 while (frames > 0) { 93 while (frames > 0) {
96 transfer = ofs + frames > runtime->buffer_size ? runtime->buffer_size - ofs : frames; 94 transfer = ofs + frames > runtime->buffer_size ? runtime->buffer_size - ofs : frames;
97 if (runtime->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED || 95 if (runtime->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED ||