aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYotam Barnoy2010-09-25 20:38:40 +0000
committerYotam Barnoy2010-09-25 20:38:40 +0000
commit73c5895ed26d49ae04600be8bf1247335e89fb4d (patch)
treeeea27a85fffbd2ca48bc9e61735df212f81ea726
parent7105e294e2b48c498fd22d555bff0d6851148109 (diff)
downloadscummvm-rg350-73c5895ed26d49ae04600be8bf1247335e89fb4d.tar.gz
scummvm-rg350-73c5895ed26d49ae04600be8bf1247335e89fb4d.tar.bz2
scummvm-rg350-73c5895ed26d49ae04600be8bf1247335e89fb4d.zip
PSP: ME MP3: cache stereo status
Bad timing can cause stereo status not to be picked up if at some point a MAD _header is not initialized. svn-id: r52890
-rw-r--r--backends/platform/psp/mp3.cpp1
-rw-r--r--backends/platform/psp/mp3.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/backends/platform/psp/mp3.cpp b/backends/platform/psp/mp3.cpp
index da189c532c..574cf0d719 100644
--- a/backends/platform/psp/mp3.cpp
+++ b/backends/platform/psp/mp3.cpp
@@ -190,6 +190,7 @@ Mp3PspStream::Mp3PspStream(Common::SeekableReadStream *inStream, DisposeAfterUse
findValidHeader(); // get a first header so we can read basic stuff
_sampleRate = _header.samplerate; // copy it before it gets destroyed
+ _stereo = (MAD_NCHANNELS(&_header) == 2);
while (_state != MP3_STATE_EOS)
findValidHeader(); // get a first header so we can read basic stuff
diff --git a/backends/platform/psp/mp3.h b/backends/platform/psp/mp3.h
index 983f4cb7f4..71a248ad78 100644
--- a/backends/platform/psp/mp3.h
+++ b/backends/platform/psp/mp3.h
@@ -61,6 +61,7 @@ protected:
Timestamp _length;
uint32 _sampleRate;
+ bool _stereo;
mad_timer_t _totalTime;
mad_stream _stream; //
@@ -110,7 +111,7 @@ public:
int readBuffer(int16 *buffer, const int numSamples);
bool endOfData() const { return _state == MP3_STATE_EOS; }
- bool isStereo() const { return MAD_NCHANNELS(&_header) == 2; }
+ bool isStereo() const { return _stereo; }
int getRate() const { return _sampleRate; }
bool seek(const Timestamp &where);