From 866961bde9302d20f4ce6aabfead01dd8111d526 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 26 Jan 2013 03:42:29 +0200 Subject: VIDEO: Hook some more of our ADPCM decoder variants to our AVI video decoder Information for the AVI audio track format IDs has been taken from libav. Thanks to clone2727 for his great help on this. --- video/avi_decoder.cpp | 6 +++++- video/avi_decoder.h | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp index 6062049b72..6fe9c773b8 100644 --- a/video/avi_decoder.cpp +++ b/video/avi_decoder.cpp @@ -457,6 +457,10 @@ void AVIDecoder::AVIAudioTrack::queueSound(Common::SeekableReadStream *stream) { flags |= Audio::FLAG_STEREO; _audStream->queueAudioStream(Audio::makeRawStream(stream, _wvInfo.samplesPerSec, flags, DisposeAfterUse::YES), DisposeAfterUse::YES); + } else if (_wvInfo.tag == kWaveFormatMSADPCM) { + _audStream->queueAudioStream(Audio::makeADPCMStream(stream, DisposeAfterUse::YES, stream->size(), Audio::kADPCMMS, _wvInfo.samplesPerSec, _wvInfo.channels, _wvInfo.blockAlign), DisposeAfterUse::YES); + } else if (_wvInfo.tag == kWaveFormatMSIMAADPCM) { + _audStream->queueAudioStream(Audio::makeADPCMStream(stream, DisposeAfterUse::YES, stream->size(), Audio::kADPCMMSIma, _wvInfo.samplesPerSec, _wvInfo.channels, _wvInfo.blockAlign), DisposeAfterUse::YES); } else if (_wvInfo.tag == kWaveFormatDK3) { _audStream->queueAudioStream(Audio::makeADPCMStream(stream, DisposeAfterUse::YES, stream->size(), Audio::kADPCMDK3, _wvInfo.samplesPerSec, _wvInfo.channels, _wvInfo.blockAlign), DisposeAfterUse::YES); } @@ -470,7 +474,7 @@ Audio::AudioStream *AVIDecoder::AVIAudioTrack::getAudioStream() const { } Audio::QueuingAudioStream *AVIDecoder::AVIAudioTrack::createAudioStream() { - if (_wvInfo.tag == kWaveFormatPCM || _wvInfo.tag == kWaveFormatDK3) + if (_wvInfo.tag == kWaveFormatPCM || _wvInfo.tag == kWaveFormatMSADPCM || _wvInfo.tag == kWaveFormatMSIMAADPCM || _wvInfo.tag == kWaveFormatDK3) return Audio::makeQueuingAudioStream(_wvInfo.samplesPerSec, _wvInfo.channels == 2); else if (_wvInfo.tag != kWaveFormatNone) // No sound warning("Unsupported AVI audio format %d", _wvInfo.tag); diff --git a/video/avi_decoder.h b/video/avi_decoder.h index 3bdc0561d1..34a67f4c28 100644 --- a/video/avi_decoder.h +++ b/video/avi_decoder.h @@ -203,7 +203,9 @@ private: enum { kWaveFormatNone = 0, kWaveFormatPCM = 1, - kWaveFormatDK3 = 98 + kWaveFormatMSADPCM = 2, + kWaveFormatMSIMAADPCM = 17, + kWaveFormatDK3 = 98 // rogue format number }; AVIStreamHeader _audsHeader; -- cgit v1.2.3