diff options
author | Paul Gilbert | 2016-09-02 23:54:55 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-09-02 23:54:55 -0400 |
commit | d7e52b4b50c1fa192d25e094f0a5f9ad6e8caadf (patch) | |
tree | 6ad436d865fe8af0e0dc8ed3249b95cb1b0b90fc /audio | |
parent | d971dbea406925760e74e17ffe329d637ad962d6 (diff) | |
download | scummvm-rg350-d7e52b4b50c1fa192d25e094f0a5f9ad6e8caadf.tar.gz scummvm-rg350-d7e52b4b50c1fa192d25e094f0a5f9ad6e8caadf.tar.bz2 scummvm-rg350-d7e52b4b50c1fa192d25e094f0a5f9ad6e8caadf.zip |
AUDIO: Disable MP3 decoding in Wave files if MAD dependency is disabled
Diffstat (limited to 'audio')
-rw-r--r-- | audio/decoders/wave.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/audio/decoders/wave.cpp b/audio/decoders/wave.cpp index 6da0f2a516..803bdf3cf0 100644 --- a/audio/decoders/wave.cpp +++ b/audio/decoders/wave.cpp @@ -106,11 +106,18 @@ bool loadWAVFromStream(Common::SeekableReadStream &stream, int &size, int &rate, debug(" bitsPerSample: %d", bitsPerSample); #endif + #ifdef USE_MAD if (type == kWaveFormatMP3) { bitsPerSample = 8; } else { + #endif if (type != kWaveFormatPCM && type != kWaveFormatMSADPCM && type != kWaveFormatMSIMAADPCM) { + #ifdef USE_MAD warning("getWavInfo: only PCM, MS ADPCM, MP3, or IMA ADPCM data is supported (type %d)", type); + #else + warning("getWavInfo: only PCM, MS ADPCM, or IMA ADPCM data is supported (type %d)", type); + #endif + return false; } @@ -121,7 +128,9 @@ bool loadWAVFromStream(Common::SeekableReadStream &stream, int &size, int &rate, if (avgBytesPerSec != samplesPerSec * blockAlign && type != kWaveFormatMSADPCM) { debug(0, "getWavInfo: avgBytesPerSec is invalid"); } + #ifdef USE_MAD } + #endif // Prepare the return values. rate = samplesPerSec; @@ -187,8 +196,10 @@ SeekableAudioStream *makeWAVStream(Common::SeekableReadStream *stream, DisposeAf return makeADPCMStream(stream, disposeAfterUse, size, Audio::kADPCMMSIma, rate, (flags & Audio::FLAG_STEREO) ? 2 : 1, blockAlign); else if (type == kWaveFormatMSADPCM) // MS ADPCM return makeADPCMStream(stream, disposeAfterUse, size, Audio::kADPCMMS, rate, (flags & Audio::FLAG_STEREO) ? 2 : 1, blockAlign); + #ifdef USE_MAD else if (type == kWaveFormatMP3) return makeMP3Stream(stream, disposeAfterUse); + #endif // Raw PCM, make sure the last packet is complete uint sampleSize = (flags & Audio::FLAG_16BITS ? 2 : 1) * (flags & Audio::FLAG_STEREO ? 2 : 1); |