Skip to content

Commit

Permalink
VIDEO: Hook some more of our ADPCM decoder variants to our AVI video …
Browse files Browse the repository at this point in the history
…decoder

Information for the AVI audio track format IDs has been taken from libav.
Thanks to clone2727 for his great help on this.
  • Loading branch information
bluegr committed Jan 26, 2013
1 parent fefa3bd commit 866961b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion video/avi_decoder.cpp
Expand Up @@ -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);
}
Expand All @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion video/avi_decoder.h
Expand Up @@ -203,7 +203,9 @@ class AVIDecoder : public VideoDecoder {
enum {
kWaveFormatNone = 0,
kWaveFormatPCM = 1,
kWaveFormatDK3 = 98
kWaveFormatMSADPCM = 2,
kWaveFormatMSIMAADPCM = 17,
kWaveFormatDK3 = 98 // rogue format number
};

AVIStreamHeader _audsHeader;
Expand Down

0 comments on commit 866961b

Please sign in to comment.