diff options
author | Brandon Low <lostlogic@rockbox.org> | 2006-03-09 21:25:08 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@rockbox.org> | 2006-03-09 21:25:08 +0000 |
commit | 7bc5bc4b495a6c31cce0e8df258b50f1bd3a7a44 (patch) | |
tree | 7e9ad7841905d452aa4a0aeeb718d3eea617dbc0 | |
parent | 19f4c2a093698940482aad6df0bd8478a82f2a9d (diff) | |
download | rockbox-7bc5bc4b495a6c31cce0e8df258b50f1bd3a7a44.tar.gz rockbox-7bc5bc4b495a6c31cce0e8df258b50f1bd3a7a44.zip |
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
-rw-r--r-- | firmware/pcm_playback.c | 4 |
1 files 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) | |||
774 | #endif | 774 | #endif |
775 | 775 | ||
776 | if (samples > PEAK_SAMPLES) | 776 | if (samples > PEAK_SAMPLES) |
777 | samples = PEAK_SAMPLES - (PEAK_STRIDE - 1); | 777 | samples = PEAK_SAMPLES - PEAK_STRIDE; |
778 | else | 778 | else |
779 | samples -= MIN((PEAK_STRIDE - 1), samples); | 779 | samples -= MIN(PEAK_STRIDE, samples); |
780 | 780 | ||
781 | end = addr + samples * 4; | 781 | end = addr + samples * 4; |
782 | } | 782 | } |