aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/sound/audio32.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/engines/sci/sound/audio32.cpp b/engines/sci/sound/audio32.cpp
index be3f99dcea..7622305adb 100644
--- a/engines/sci/sound/audio32.cpp
+++ b/engines/sci/sound/audio32.cpp
@@ -842,6 +842,9 @@ uint16 Audio32::play(int16 channelIndex, const ResourceId resourceId, const bool
channel.startedAtTick = now;
if (_numActiveChannels == 1) {
+ if (_pausedAtTick) {
+ _pausedAtTick = now;
+ }
_startedAtTick = now;
}
@@ -868,18 +871,29 @@ bool Audio32::resume(const int16 channelIndex) {
AudioChannel &channel = getChannel(i);
if (!channel.pausedAtTick) {
channel.startedAtTick += now - _pausedAtTick;
+ if (channel.startedAtTick > now) {
+ warning("%s is being resumed in the future", channel.id.toString().c_str());
+ }
}
}
_startedAtTick += now - _pausedAtTick;
+ if (_startedAtTick > now) {
+ warning("Audio32 is being resumed in the future");
+ }
_pausedAtTick = 0;
return true;
} else if (channelIndex == kRobotChannel) {
for (int i = 0; i < _numActiveChannels; ++i) {
AudioChannel &channel = getChannel(i);
if (channel.robot) {
- channel.startedAtTick += now - channel.pausedAtTick;
- channel.pausedAtTick = 0;
+ if (channel.pausedAtTick) {
+ channel.startedAtTick += now - channel.pausedAtTick;
+ if (channel.startedAtTick > now) {
+ warning("Robot audio is being resumed in the future");
+ }
+ channel.pausedAtTick = 0;
+ }
return true;
}
}
@@ -887,6 +901,9 @@ bool Audio32::resume(const int16 channelIndex) {
AudioChannel &channel = getChannel(channelIndex);
if (channel.pausedAtTick) {
channel.startedAtTick += now - channel.pausedAtTick;
+ if (channel.startedAtTick > now) {
+ warning("%s is being resumed in the future", channel.id.toString().c_str());
+ }
channel.pausedAtTick = 0;
return true;
}