From 8d70dd68ac887df8593eb139edaa8f2a084be085 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 8 Jun 2014 22:54:07 +0300 Subject: AUDIO: Added stup for MP3 audiostreams in AVI This is used in German release of Full Pipe. Unfortunately our current MP3 decoder cannot work with streamed MP3s, and bails out at the AVI header since there is no full MP3 header yet. --- video/avi_decoder.cpp | 4 +++- video/avi_decoder.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp index 68d6cb6cec..39deaea204 100644 --- a/video/avi_decoder.cpp +++ b/video/avi_decoder.cpp @@ -833,6 +833,8 @@ void AVIDecoder::AVIAudioTrack::queueSound(Common::SeekableReadStream *stream) { _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); + } else if (_wvInfo.tag == kWaveFormatMP3) { + warning("AVI: MP3 audio stream is not supported"); } } else { delete stream; @@ -869,7 +871,7 @@ Audio::AudioStream *AVIDecoder::AVIAudioTrack::getAudioStream() const { } Audio::QueuingAudioStream *AVIDecoder::AVIAudioTrack::createAudioStream() { - if (_wvInfo.tag == kWaveFormatPCM || _wvInfo.tag == kWaveFormatMSADPCM || _wvInfo.tag == kWaveFormatMSIMAADPCM || _wvInfo.tag == kWaveFormatDK3) + if (_wvInfo.tag == kWaveFormatPCM || _wvInfo.tag == kWaveFormatMSADPCM || _wvInfo.tag == kWaveFormatMSIMAADPCM || _wvInfo.tag == kWaveFormatDK3 || _wvInfo.tag == kWaveFormatMP3) 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 28d87bc3b7..4461e537c5 100644 --- a/video/avi_decoder.h +++ b/video/avi_decoder.h @@ -229,6 +229,7 @@ protected: kWaveFormatPCM = 1, kWaveFormatMSADPCM = 2, kWaveFormatMSIMAADPCM = 17, + kWaveFormatMP3 = 85, kWaveFormatDK3 = 98 // rogue format number }; -- cgit v1.2.3