From e8fd75c4cf17f1ee45009aa2c91f0648ecf87026 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 4 Nov 2006 23:30:14 +0000 Subject: Fix an assumption about the number of channels. Symptoms could be buffer overruns (monaural streams) or incomplete processing. Original version of the patch is from Steve Freeland . CVS patchset: 8358 CVS date: 2006/11/04 23:30:14 --- src/xine-engine/audio_out.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 59ac6f585..ce8cbe536 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -17,7 +17,7 @@ * along with self program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_out.c,v 1.206 2006/10/16 22:18:24 valtri Exp $ + * $Id: audio_out.c,v 1.207 2006/11/04 23:30:14 dsalt Exp $ * * 22-8-2001 James imported some useful AC3 sections from the previous alsa driver. * (c) 2001 Andy Lo A Foe @@ -625,7 +625,7 @@ static void audio_filter_amp (aos_t *this, void *buf, int num_frames) { static void audio_filter_equalize (aos_t *this, int16_t *data, int num_frames) { int index, band, channel; - int halflength, length; + int length; int out[EQ_CHANNELS], scaledpcm[EQ_CHANNELS]; int64_t l; int num_channels; @@ -634,10 +634,9 @@ static void audio_filter_equalize (aos_t *this, if (!num_channels) return; - halflength = num_frames * 2; - length = num_frames * 4; + length = num_frames * num_channels; - for (index = 0; index < halflength; index+=2) { + for (index = 0; index < length; index += num_channels) { for (channel = 0; channel < num_channels; channel++) { -- cgit v1.2.3