diff options
author | Matthew Hoops | 2011-04-08 22:46:19 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-04-08 22:46:19 -0400 |
commit | 7c5dfaa04c2d02a22b301823bedb2940c3e590aa (patch) | |
tree | cb3feb850b2095f1f717ebe9ab99ad7ecd8fa5b6 /audio/decoders | |
parent | faee277978c54ccb3dcccfedc75ddb31f44e630f (diff) | |
download | scummvm-rg350-7c5dfaa04c2d02a22b301823bedb2940c3e590aa.tar.gz scummvm-rg350-7c5dfaa04c2d02a22b301823bedb2940c3e590aa.tar.bz2 scummvm-rg350-7c5dfaa04c2d02a22b301823bedb2940c3e590aa.zip |
COMMON: Parse the MPEG-4 esds atom
Diffstat (limited to 'audio/decoders')
-rw-r--r-- | audio/decoders/quicktime.cpp | 19 | ||||
-rw-r--r-- | audio/decoders/quicktime.h | 2 |
2 files changed, 15 insertions, 6 deletions
diff --git a/audio/decoders/quicktime.cpp b/audio/decoders/quicktime.cpp index 62a6f6e404..e18ba7c480 100644 --- a/audio/decoders/quicktime.cpp +++ b/audio/decoders/quicktime.cpp @@ -76,7 +76,7 @@ void QuickTimeAudioDecoder::init() { if (_audioStreamIndex >= 0) { AudioSampleDesc *entry = (AudioSampleDesc *)_streams[_audioStreamIndex]->sampleDescs[0]; - if (checkAudioCodecSupport(entry->codecTag)) { + if (checkAudioCodecSupport(entry->codecTag, _streams[_audioStreamIndex]->objectTypeMP4)) { _audStream = makeQueuingAudioStream(entry->sampleRate, entry->channels == 2); _curAudioChunk = 0; @@ -140,7 +140,7 @@ Common::QuickTimeParser::SampleDesc *QuickTimeAudioDecoder::readSampleDesc(MOVSt return 0; } -bool QuickTimeAudioDecoder::checkAudioCodecSupport(uint32 tag) { +bool QuickTimeAudioDecoder::checkAudioCodecSupport(uint32 tag, byte objectTypeMP4) { // Check if the codec is a supported codec if (tag == MKID_BE('twos') || tag == MKID_BE('raw ') || tag == MKID_BE('ima4')) return true; @@ -150,9 +150,18 @@ bool QuickTimeAudioDecoder::checkAudioCodecSupport(uint32 tag) { return true; #endif - if (tag == MKID_BE('mp4a')) - warning("No MPEG-4 audio (AAC) support"); - else + if (tag == MKID_BE('mp4a')) { + Common::String audioType; + switch (objectTypeMP4) { + case 0x40: + audioType = "AAC"; + break; + default: + audioType = "Unknown"; + break; + } + warning("No MPEG-4 audio (%s) support", audioType.c_str()); + } else warning("Audio Codec Not Supported: \'%s\'", tag2str(tag)); return false; diff --git a/audio/decoders/quicktime.h b/audio/decoders/quicktime.h index be4d1097da..6e9f5b2c4e 100644 --- a/audio/decoders/quicktime.h +++ b/audio/decoders/quicktime.h @@ -72,7 +72,7 @@ protected: virtual Common::QuickTimeParser::SampleDesc *readSampleDesc(MOVStreamContext *st, uint32 format); AudioStream *createAudioStream(Common::SeekableReadStream *stream); - bool checkAudioCodecSupport(uint32 tag); + bool checkAudioCodecSupport(uint32 tag, byte objectTypeMP4); void init(); void queueNextAudioChunk(); |