From 0e3b395943d4f7b057ae04589c82174ee5a43ee0 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 11 Aug 2010 23:45:32 +0000 Subject: [PATCH] ok, non-resampled flacs now work beautifully --- libs/audio/renderer/flac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/audio/renderer/flac.c b/libs/audio/renderer/flac.c index d9a57a653..1972da231 100644 --- a/libs/audio/renderer/flac.c +++ b/libs/audio/renderer/flac.c @@ -159,7 +159,8 @@ flac_write_func (const FLAC__StreamDecoder *decoder, float *out; float scale = 2.0 / (1 << ff->info.bits_per_sample); int step = ff->info.channels; - unsigned i, j; + unsigned j; + int i; if (!ff->buffer) ff->buffer = calloc (ff->info.max_blocksize * ff->info.channels, @@ -265,7 +266,7 @@ flac_read (flacfile_t *ff, float *buf, int len) res * ff->info.channels * sizeof (float)); count += res; len -= res; - buf += res; + buf += res * ff->info.channels; ff->pos += res; } else if (res < 0) { Sys_Printf ("flac error %d\n", res);