diff options
-rw-r--r-- | engines/scumm/player_mod.cpp | 6 | ||||
-rw-r--r-- | engines/scumm/sound.cpp | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/engines/scumm/player_mod.cpp b/engines/scumm/player_mod.cpp index c98120a2c0..28ee5059e6 100644 --- a/engines/scumm/player_mod.cpp +++ b/engines/scumm/player_mod.cpp @@ -97,7 +97,11 @@ void Player_MOD::startChannel(int id, void *data, int size, int rate, uint8 vol, _channels[i].ctr = 0; Audio::SeekableAudioStream *stream = Audio::makeRawStream((const byte *)data, size, rate, 0); - _channels[i].input = Audio::makeLoopingAudioStream(stream, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate), loopStart == loopEnd ? 1 : 0); + if (loopStart != loopEnd) { + _channels[i].input = new Audio::SubLoopingAudioStream(stream, 0, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate)); + } else { + _channels[i].input = stream; + } // read the first sample _channels[i].input->readBuffer(&_channels[i].pos, 1); diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 69b298d30d..aed412039a 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -350,7 +350,7 @@ void Sound::playSound(int soundID) { size -= waveSize; Audio::SeekableAudioStream *s = Audio::makeRawStream(sound, waveSize, rate, Audio::FLAG_UNSIGNED); - stream = Audio::makeLoopingAudioStream(s, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate), 0); + stream = new Audio::SubLoopingAudioStream(s, 0, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate)); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID, 255, 0); } break; @@ -441,7 +441,7 @@ void Sound::playSound(int soundID) { // TODO: Currently we will only ever play till "loopEnd", even when we only have // a finite repetition count. - stream = Audio::makeLoopingAudioStream(plainStream, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate), loopcount == 255 ? 0 : loopcount); + stream = new Audio::SubLoopingAudioStream(plainStream, loopcount == 255 ? 0 : loopcount, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate)); } else { stream = plainStream; } |