aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/psp/mp3.h
diff options
context:
space:
mode:
authorYotam Barnoy2010-08-18 16:58:32 +0000
committerYotam Barnoy2010-08-18 16:58:32 +0000
commit70cd6cfda52ed4feca562aa1b52d3a6c52a4ccba (patch)
treec61529727dc3ce4fe8abe6d34270052eaaacda16 /backends/platform/psp/mp3.h
parent844b4665738b7946b072c55ad257ed535f8399ca (diff)
downloadscummvm-rg350-70cd6cfda52ed4feca562aa1b52d3a6c52a4ccba.tar.gz
scummvm-rg350-70cd6cfda52ed4feca562aa1b52d3a6c52a4ccba.tar.bz2
scummvm-rg350-70cd6cfda52ed4feca562aa1b52d3a6c52a4ccba.zip
PSP: fixed issue in ME MP3 player that prevented different MP3 layers and versions from working.
MAD doesn't give enough information to decide the length of the PCM data -- it provides the Layer but not the MPEG version. I had to read the MP3 header directly to figure it out. This fixes issues with any MP3 files that might be used in any of the games. svn-id: r52191
Diffstat (limited to 'backends/platform/psp/mp3.h')
-rw-r--r--backends/platform/psp/mp3.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/backends/platform/psp/mp3.h b/backends/platform/psp/mp3.h
index 029b3e498c..983f4cb7f4 100644
--- a/backends/platform/psp/mp3.h
+++ b/backends/platform/psp/mp3.h
@@ -46,7 +46,7 @@ protected:
MP3_STATE_EOS // end of data reached (may need to loop)
};
- #define MAX_SAMPLES_PER_FRAME 2048 * 2
+ #define MAX_SAMPLES_PER_FRAME 1152 * 2 /* x2 for stereo */
int16 _pcmSamples[MAX_SAMPLES_PER_FRAME] __attribute__((aligned(64))); // samples to output PCM data into
byte _codecInBuffer[3072] __attribute__((aligned(64))); // the codec always needs alignment
unsigned long _codecParams[65]__attribute__((aligned(64))); // TODO: change to struct
@@ -54,7 +54,7 @@ protected:
Common::SeekableReadStream *_inStream;
DisposeAfterUse::Flag _disposeAfterUse;
- uint32 _pcmLength; // how many pcm samples we have (/2 for mono)
+ uint32 _pcmLength; // how many pcm samples we have for this type of file (x2 this for stereo)
uint _posInFrame; // position in frame
State _state; // what state the stream is in
@@ -83,7 +83,8 @@ protected:
int initStream();
void findValidHeader();
void deinitStream();
-
+ void updatePcmLength();
+
// to init and uninit ME decoder
static bool initDecoder();
static bool stopDecoder();