diff options
author | Travis Howell | 2010-03-02 00:18:00 +0000 |
---|---|---|
committer | Travis Howell | 2010-03-02 00:18:00 +0000 |
commit | d204f97beb9dc3791d1a01959735bc3c4049318c (patch) | |
tree | 9667b46efe50ae6adc8a83d68a4f21b894fe70c4 | |
parent | 3c9377af089df61f6ad48c959a4ab200b4af74ef (diff) | |
download | scummvm-rg350-d204f97beb9dc3791d1a01959735bc3c4049318c.tar.gz scummvm-rg350-d204f97beb9dc3791d1a01959735bc3c4049318c.tar.bz2 scummvm-rg350-d204f97beb9dc3791d1a01959735bc3c4049318c.zip |
Fix bug #2961530 - Zak/FM-Towns: Game hangs when using monkey wrench.
svn-id: r48158
-rw-r--r-- | engines/scumm/sound.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index a87bc835ec..19be224356 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -349,8 +349,12 @@ void Sound::playSound(int soundID) { } size -= waveSize; - Audio::SeekableAudioStream *s = Audio::makeRawStream(sound, waveSize, rate, Audio::FLAG_UNSIGNED); - stream = new Audio::SubLoopingAudioStream(s, 0, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate)); + if (loopEnd > 0) { + Audio::SeekableAudioStream *s = Audio::makeRawStream(sound, waveSize, rate, Audio::FLAG_UNSIGNED); + stream = new Audio::SubLoopingAudioStream(s, 0, Audio::Timestamp(0, loopStart, rate), Audio::Timestamp(0, loopEnd, rate)); + } else { + stream = Audio::makeRawStream(sound, waveSize, rate, Audio::FLAG_UNSIGNED); + } _mixer->playInputStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID, 255, 0); } break; |