diff options
-rw-r--r-- | sound/iff_sound.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sound/iff_sound.cpp b/sound/iff_sound.cpp index 704e3a0543..2ec97d005b 100644 --- a/sound/iff_sound.cpp +++ b/sound/iff_sound.cpp @@ -108,16 +108,21 @@ AudioStream *make8SVXStream(Common::ReadStream &input, bool loop) { A8SVXLoader loader; loader.load(input); - uint32 loopStart = 0, loopEnd = 0, flags = 0; + SeekableAudioStream *stream = Audio::makeRawMemoryStream((byte *)loader._data, loader._dataSize, DisposeAfterUse::YES, loader._header.samplesPerSec, 0); + + uint32 loopStart = 0, loopEnd = 0; if (loop) { // the standard way to loop 8SVX audio implies use of the oneShotHiSamples and // repeatHiSamples fields loopStart = loader._header.oneShotHiSamples; loopEnd = loader._header.oneShotHiSamples + loader._header.repeatHiSamples; - flags |= Audio::FLAG_LOOP; + + return new SubLoopingAudioStream(stream, 0, + Timestamp(0, loopStart, loader._header.samplesPerSec), + Timestamp(0, loopEnd, loader._header.samplesPerSec)); } - return Audio::makeRawMemoryStream((byte *)loader._data, loader._dataSize, DisposeAfterUse::YES, loader._header.samplesPerSec, flags, loopStart, loopEnd); + return stream; } } |