From 2050987fa1ecc347bdc707b58d185804a875106d Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Thu, 17 Oct 2013 21:03:08 +0000 Subject: ZVISION: Detach raw stream reader from RawZorkStream for creating correct avi raw reader. --- engines/zvision/zork_avi_decoder.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'engines/zvision/zork_avi_decoder.cpp') diff --git a/engines/zvision/zork_avi_decoder.cpp b/engines/zvision/zork_avi_decoder.cpp index a614f77bb7..0711cdf9d7 100644 --- a/engines/zvision/zork_avi_decoder.cpp +++ b/engines/zvision/zork_avi_decoder.cpp @@ -30,6 +30,7 @@ #include "common/stream.h" #include "audio/audiostream.h" +#include "audio/decoders/raw.h" namespace ZVision { @@ -43,9 +44,14 @@ void ZorkAVIDecoder::ZorkAVIAudioTrack::queueSound(Common::SeekableReadStream *s if (_audStream) { if (_wvInfo.tag == kWaveFormatZorkPCM) { assert(_wvInfo.size == 8); - _audStream->queueAudioStream(makeRawZorkStream(stream, _wvInfo.samplesPerSec, _audStream->isStereo(), DisposeAfterUse::YES), DisposeAfterUse::YES); + RawChunkStream::RawChunk chunk = decoder->readNextChunk(stream); + delete stream; + + if (chunk.data) + _audStream->queueBuffer((byte *)chunk.data, chunk.size, DisposeAfterUse::YES, Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN | Audio::FLAG_STEREO); } } else { + warning("Got %d wave format in AVI\n", _wvInfo.tag); delete stream; } } -- cgit v1.2.3