diff options
author | Colin Snover | 2016-06-24 14:47:15 -0500 |
---|---|---|
committer | Colin Snover | 2016-06-26 10:56:36 -0500 |
commit | c5914eb80db79233766b2b6070ee92c637a18069 (patch) | |
tree | f45f9cf0c4a05570136a6799892e182a8702e18b /engines/sci/sound | |
parent | 6ec206ccee670254f591c93a7421e16ad3124a66 (diff) | |
download | scummvm-rg350-c5914eb80db79233766b2b6070ee92c637a18069.tar.gz scummvm-rg350-c5914eb80db79233766b2b6070ee92c637a18069.tar.bz2 scummvm-rg350-c5914eb80db79233766b2b6070ee92c637a18069.zip |
SCI32: Fix hang when playing auto-play audio channels
Diffstat (limited to 'engines/sci/sound')
-rw-r--r-- | engines/sci/sound/audio32.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/engines/sci/sound/audio32.cpp b/engines/sci/sound/audio32.cpp index 1714d3da3c..20595b073b 100644 --- a/engines/sci/sound/audio32.cpp +++ b/engines/sci/sound/audio32.cpp @@ -596,14 +596,11 @@ uint16 Audio32::play(int16 channelIndex, const ResourceId resourceId, const bool AudioChannel &channel = getChannel(channelIndex); channel.id = resourceId; channel.resource = resource; - // resourceStream, stream, converter, duration and startedAtTick will be initialized below - channel.pausedAtTick = 0; channel.loop = loop; - channel.lastFadeTick = 0; - channel.fadeStepsRemaining = 0; - // fadeVolume, fadeSpeed and stopChannelOnFade will be initialized once they are actually used channel.robot = false; channel.vmd = false; + channel.lastFadeTick = 0; + channel.fadeStepsRemaining = 0; channel.soundNode = soundNode; channel.volume = volume < 0 || volume > kMaxVolume ? (int)kMaxVolume : volume; // TODO: SCI3 introduces stereo audio @@ -648,9 +645,7 @@ uint16 Audio32::play(int16 channelIndex, const ResourceId resourceId, const bool channel.duration = /* round up */ 1 + (channel.stream->getLength().msecs() * 60 / 1000); const uint32 now = g_sci->getTickCount(); - if (!autoPlay) { - channel.pausedAtTick = now; - } + channel.pausedAtTick = autoPlay ? 0 : now; channel.startedAtTick = now; if (_numActiveChannels == 1) { |