#include "helix/pub/mp3dec.h"
#include "lprintf.h"
-static short mp3_out_buffer[2*1152];
static HMP3Decoder mp3dec = 0;
static int mp3_buffer_offs = 0;
readPtr += offset;
bytesLeft -= offset;
- err = MP3Decode(mp3dec, &readPtr, &bytesLeft, mp3_out_buffer, 0);
+ err = MP3Decode(mp3dec, &readPtr, &bytesLeft, cdda_out_buffer, 0);
if (err) {
if (err == ERR_MP3_INDATA_UNDERFLOW) {
shared_ctl->mp3_offs = shared_ctl->mp3_len; // EOF
#define mp3_update mp3_update_local
-#else
+#else // !__GP2X__
static FILE *mp3_current_file = NULL;
static int mp3_file_len = 0, mp3_file_pos = 0;
readPtr = mp3_input_buffer + offset;
bytesLeft -= offset;
- err = MP3Decode(mp3dec, &readPtr, &bytesLeft, mp3_out_buffer, 0);
+ err = MP3Decode(mp3dec, &readPtr, &bytesLeft, cdda_out_buffer, 0);
if (err) {
//lprintf("MP3Decode err (%i/%i) %i\n", mp3_file_pos, mp3_file_len, err);
if (err == ERR_MP3_INDATA_UNDERFLOW) {
else if (PsndRate == 11025) { mix_samples = mix_16h_to_32_s2; length_mp3 <<= 2; shr = 2; }
if (1152 - mp3_buffer_offs >= length_mp3) {
- mix_samples(buffer, mp3_out_buffer + mp3_buffer_offs*2, length<<1);
+ mix_samples(buffer, cdda_out_buffer + mp3_buffer_offs*2, length<<1);
mp3_buffer_offs += length_mp3;
} else {
int ret, left = 1152 - mp3_buffer_offs;
- mix_samples(buffer, mp3_out_buffer + mp3_buffer_offs*2, (left>>shr)<<1);
+ mix_samples(buffer, cdda_out_buffer + mp3_buffer_offs*2, (left>>shr)<<1);
ret = mp3_decode();
if (ret == 0) {
mp3_buffer_offs = length_mp3 - left;
- mix_samples(buffer + ((left>>shr)<<1), mp3_out_buffer, (mp3_buffer_offs>>shr)<<1);
+ mix_samples(buffer + ((left>>shr)<<1), cdda_out_buffer, (mp3_buffer_offs>>shr)<<1);
} else
mp3_buffer_offs = 0;
}