diff options
Diffstat (limited to 'sound/decoders')
-rw-r--r-- | sound/decoders/adpcm.cpp | 4 | ||||
-rw-r--r-- | sound/decoders/mp3.cpp | 15 | ||||
-rw-r--r-- | sound/decoders/voc.cpp | 2 | ||||
-rw-r--r-- | sound/decoders/vorbis.cpp | 2 |
4 files changed, 20 insertions, 3 deletions
diff --git a/sound/decoders/adpcm.cpp b/sound/decoders/adpcm.cpp index 7a85bc24d5..c8a907d13e 100644 --- a/sound/decoders/adpcm.cpp +++ b/sound/decoders/adpcm.cpp @@ -724,6 +724,10 @@ int16 Ima_ADPCMStream::decodeIMA(byte code, int channel) { } RewindableAudioStream *makeADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, typesADPCM type, int rate, int channels, uint32 blockAlign) { + // If size is 0, report the entire size of the stream + if (!size) + size = stream->size(); + switch (type) { case kADPCMOki: return new Oki_ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign); diff --git a/sound/decoders/mp3.cpp b/sound/decoders/mp3.cpp index f66d6324ef..732ae58b67 100644 --- a/sound/decoders/mp3.cpp +++ b/sound/decoders/mp3.cpp @@ -36,7 +36,9 @@ #include <mad.h> - +#if defined(__PSP__) + #include "backends/platform/psp/mp3.h" +#endif namespace Audio { @@ -347,7 +349,18 @@ int MP3Stream::readBuffer(int16 *buffer, const int numSamples) { SeekableAudioStream *makeMP3Stream( Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse) { + +#if defined(__PSP__) + SeekableAudioStream *s = 0; + + if (Mp3PspStream::isOkToCreateStream()) + s = new Mp3PspStream(stream, disposeAfterUse); + + if (!s) // go to regular MAD mp3 stream if ME fails + s = new MP3Stream(stream, disposeAfterUse); +#else SeekableAudioStream *s = new MP3Stream(stream, disposeAfterUse); +#endif if (s && s->endOfData()) { delete s; return 0; diff --git a/sound/decoders/voc.cpp b/sound/decoders/voc.cpp index 5663861f05..e9af7ece3f 100644 --- a/sound/decoders/voc.cpp +++ b/sound/decoders/voc.cpp @@ -384,7 +384,7 @@ AudioStream *makeVOCStream(Common::SeekableReadStream *stream, byte flags, uint SeekableAudioStream *makeVOCStream(Common::SeekableReadStream *stream, byte flags, DisposeAfterUse::Flag disposeAfterUse) { #ifdef STREAM_AUDIO_FROM_DISK - return makeVOCDiskStreamNoLoop(*stream, flags, disposeAfterUse); + return makeVOCDiskStreamNoLoop(stream, flags, disposeAfterUse); #else int size, rate; diff --git a/sound/decoders/vorbis.cpp b/sound/decoders/vorbis.cpp index 39068603de..64869d7843 100644 --- a/sound/decoders/vorbis.cpp +++ b/sound/decoders/vorbis.cpp @@ -35,7 +35,7 @@ #include "sound/audiocd.h" #ifdef USE_TREMOR -#ifdef __GP32__ // GP32 uses custom libtremor +#if defined(ANDROID) || defined(__GP32__) // custom libtremor locations #include <ivorbisfile.h> #else #include <tremor/ivorbisfile.h> |