Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9a826ddba6e087b1be24dd78cd0eac42f7eb7e97 Commit: 9a826ddba6e087b1be24dd78cd0eac42f7eb7e97 Parent: 3bc89529594767b0f894589f6c05b2d9821b6791 Author: Clemens Ladisch <[EMAIL PROTECTED]> AuthorDate: Mon Oct 23 16:26:57 2006 +0200 Committer: Jaroslav Kysela <[EMAIL PROTECTED]> CommitDate: Wed Dec 20 08:55:43 2006 +0100
[ALSA] pcm core: fix silence_start calculations The case where silence_size < boundary was broken because different parts of the snd_pcm_playback_silence() function disagreed about whether silence_start should point to the start or to the end of the buffer part to be silenced. This patch changes the code to always use to the start, which also simplifies several calculations. Signed-off-by: Clemens Ladisch <[EMAIL PROTECTED]> Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]> --- sound/core/pcm_lib.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 0bb142a..b336797 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 runtime->silence_filled -= frames; if ((snd_pcm_sframes_t)runtime->silence_filled < 0) { runtime->silence_filled = 0; - runtime->silence_start = (ofs + frames) - runtime->buffer_size; + runtime->silence_start = new_hw_ptr; } else { - runtime->silence_start = ofs - runtime->silence_filled; + runtime->silence_start = ofs; } - if ((snd_pcm_sframes_t)runtime->silence_start < 0) - runtime->silence_start += runtime->boundary; } frames = runtime->buffer_size - runtime->silence_filled; } snd_assert(frames <= runtime->buffer_size, return); if (frames == 0) return; - ofs = (runtime->silence_start + runtime->silence_filled) % runtime->buffer_size; + ofs = runtime->silence_start % runtime->buffer_size; while (frames > 0) { transfer = ofs + frames > runtime->buffer_size ? runtime->buffer_size - ofs : frames; if (runtime->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED || - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html