[Scummvm-git-logs] scummvm master -> 7e69d548d7f86b66f4e4e138a480b5a68515ab13
sev-
noreply at scummvm.org
Thu Dec 8 22:15:15 UTC 2022
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3703fee378 DIRECTOR: Do not reset looping handle early
7e69d548d7 DIRECTOR: Consider looped sounds not playing after first iteration
Commit: 3703fee3784c0b6ddcf5d37a9f2997a9bbad936a
https://github.com/scummvm/scummvm/commit/3703fee3784c0b6ddcf5d37a9f2997a9bbad936a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-12-08T23:14:54+01:00
Commit Message:
DIRECTOR: Do not reset looping handle early
playStream() is called right after setting loopPtr, which was leading
to immediate reset of loopPtr. Thus, we were not able to control
the looping sounds
Changed paths:
engines/director/sound.cpp
diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp
index a726beac532..ddbe2259f3d 100644
--- a/engines/director/sound.cpp
+++ b/engines/director/sound.cpp
@@ -106,8 +106,7 @@ void DirectorSound::playStream(Audio::AudioStream &stream, uint8 soundChannel) {
return;
cancelFade(soundChannel);
- if (_channels[soundChannel - 1].loopPtr)
- _channels[soundChannel - 1].loopPtr = nullptr;
+
_mixer->stopHandle(_channels[soundChannel - 1].handle);
_mixer->playStream(Audio::Mixer::kSFXSoundType, &_channels[soundChannel - 1].handle, &stream, -1, getChannelVolume(soundChannel));
}
Commit: 7e69d548d7f86b66f4e4e138a480b5a68515ab13
https://github.com/scummvm/scummvm/commit/7e69d548d7f86b66f4e4e138a480b5a68515ab13
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-12-08T23:14:54+01:00
Commit Message:
DIRECTOR: Consider looped sounds not playing after first iteration
Fixed exit door in the7colors, where the frame had a looping
birds chirping sound together with the following Lingo:
if the soundbusy of 2 then go to the frame
And that led to an infinite loop and inability to pass through the
opened door.
The original apparently is returning 0 in-between the sound loops
since it manually restarts the sound after its completion. We, in
contrast, are optimizing that and using LoopedAudioStream
since f48dbb43b6b6483ef2160ae3d087eb2e0f06c7e5
Changed paths:
engines/director/sound.cpp
diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp
index ddbe2259f3d..f622f447c0d 100644
--- a/engines/director/sound.cpp
+++ b/engines/director/sound.cpp
@@ -292,6 +292,12 @@ void DirectorSound::cancelFade(uint8 soundChannel) {
bool DirectorSound::isChannelActive(uint8 soundChannel) {
if (!isChannelValid(soundChannel))
return false;
+
+ // Looped sounds are considered to be inactive after the first play
+ // WORKAROUND HACK
+ if (_channels[soundChannel - 1].loopPtr != nullptr)
+ return _channels[soundChannel - 1].loopPtr->getCompleteIterations() < 1;
+
return _mixer->isSoundHandleActive(_channels[soundChannel - 1].handle);
}
More information about the Scummvm-git-logs
mailing list