diff options
author | Max Horn | 2010-01-23 13:33:27 +0000 |
---|---|---|
committer | Max Horn | 2010-01-23 13:33:27 +0000 |
commit | af536542ed360e824c0f1addb68e91b5ca367aa2 (patch) | |
tree | c98fcb5c539c597cd0f0291b675b74b3354c83f9 | |
parent | 56dea320e2769deda55efa7c1a9a1457e42f9191 (diff) | |
download | scummvm-rg350-af536542ed360e824c0f1addb68e91b5ca367aa2.tar.gz scummvm-rg350-af536542ed360e824c0f1addb68e91b5ca367aa2.tar.bz2 scummvm-rg350-af536542ed360e824c0f1addb68e91b5ca367aa2.zip |
Let the 8SVX code directly instantiate a SubLoopingAudioStream
svn-id: r47470
-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; } } |