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.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/engines/zvision/video/zork_avi_decoder.cpp b/engines/zvision/video/zork_avi_decoder.cpp
index f22a4203ab..5618250d79 100644
--- a/engines/zvision/video/zork_avi_decoder.cpp
+++ b/engines/zvision/video/zork_avi_decoder.cpp
@@ -29,7 +29,7 @@
#include "common/stream.h"
#include "audio/audiostream.h"
-
+#include "audio/decoders/raw.h"
namespace ZVision {
@@ -42,11 +42,25 @@ 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) {
+ byte flags = Audio::FLAG_16BITS | Audio::FLAG_STEREO;
+#ifdef SCUMM_LITTLE_ENDIAN
+ // RawChunkStream produces native endianness int16
+ flags |= Audio::FLAG_LITTLE_ENDIAN;
+#endif
+ _audStream->queueBuffer((byte *)chunk.data, chunk.size, DisposeAfterUse::YES, flags);
+ }
+ } else {
+ AVIAudioTrack::queueSound(stream);
}
- } else {
- delete stream;
}
}
+void ZorkAVIDecoder::ZorkAVIAudioTrack::resetStream() {
+ decoder->init();
+}
+
} // End of namespace ZVision