aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision/video/zork_avi_decoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/zvision/video/zork_avi_decoder.cpp')
-rw-r--r--engines/zvision/video/zork_avi_decoder.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/engines/zvision/video/zork_avi_decoder.cpp b/engines/zvision/video/zork_avi_decoder.cpp
index f22a4203ab..415a20d3f2 100644
--- a/engines/zvision/video/zork_avi_decoder.cpp
+++ b/engines/zvision/video/zork_avi_decoder.cpp
@@ -29,6 +29,7 @@
#include "common/stream.h"
#include "audio/audiostream.h"
+#include "audio/decoders/raw.h"
namespace ZVision {
@@ -42,11 +43,19 @@ 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 {
+ AVIAudioTrack::queueSound(stream);
}
- } else {
- delete stream;
}
}
+void ZorkAVIDecoder::ZorkAVIAudioTrack::resetStream() {
+ decoder->init();
+}
+
} // End of namespace ZVision