From 7bc5bc4b495a6c31cce0e8df258b50f1bd3a7a44 Mon Sep 17 00:00:00 2001 From: Brandon Low Date: Thu, 9 Mar 2006 21:25:08 +0000 Subject: Fix peakmeter reading off the end of the buffer, thanks to petur git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8981 a1c6a512-1295-4272-9138-f99709370657 --- firmware/pcm_playback.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/pcm_playback.c b/firmware/pcm_playback.c index 8bd44c7f21..f3098fac93 100644 --- a/firmware/pcm_playback.c +++ b/firmware/pcm_playback.c @@ -774,9 +774,9 @@ void pcm_calculate_peaks(int *left, int *right) #endif if (samples > PEAK_SAMPLES) - samples = PEAK_SAMPLES - (PEAK_STRIDE - 1); + samples = PEAK_SAMPLES - PEAK_STRIDE; else - samples -= MIN((PEAK_STRIDE - 1), samples); + samples -= MIN(PEAK_STRIDE, samples); end = addr + samples * 4; } -- cgit v1.2.3