summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2006-11-04 23:30:14 +0000
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2006-11-04 23:30:14 +0000
commite8fd75c4cf17f1ee45009aa2c91f0648ecf87026 (patch)
treefec34d507eddf3c5ce7bc652890155205c917e3d /src
parent6b1091ff5033a312fff4fb11827304601d0cd934 (diff)
downloadxine-lib-e8fd75c4cf17f1ee45009aa2c91f0648ecf87026.tar.gz
xine-lib-e8fd75c4cf17f1ee45009aa2c91f0648ecf87026.tar.bz2
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 <caucasatron@yahoo.ca>. CVS patchset: 8358 CVS date: 2006/11/04 23:30:14
Diffstat (limited to 'src')
-rw-r--r--src/xine-engine/audio_out.c9
1 files changed, 4 insertions, 5 deletions
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 <andy@alsaplayer.org>
@@ -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++) {