aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sword1/animation.cpp4
-rw-r--r--sword2/driver/animation.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/sword1/animation.cpp b/sword1/animation.cpp
index 960e8f8306..9212656762 100644
--- a/sword1/animation.cpp
+++ b/sword1/animation.cpp
@@ -307,6 +307,10 @@ bool AnimationState::decodeFrame() {
* frames if we run behind and delaying if we are too fast
*/
+ /* Avoid deadlock is sound was too far ahead */
+ if (bgSoundStream && !bgSound.isActive())
+ return false;
+
#ifdef BACKEND_8BIT
if (checkPaletteSwitch() || (bgSoundStream == NULL) ||
((_snd->getChannelElapsedTime(bgSound) * 12) / 1000 < framenum + 1)) {
diff --git a/sword2/driver/animation.cpp b/sword2/driver/animation.cpp
index 31a008cab9..4b915c913c 100644
--- a/sword2/driver/animation.cpp
+++ b/sword2/driver/animation.cpp
@@ -352,6 +352,10 @@ bool AnimationState::decodeFrame() {
* frames if we run behind and delaying if we are too fast
*/
+ /* Avoid deadlock is sound was too far ahead */
+ if (bgSoundStream && !bgSound.isActive())
+ return false;
+
#ifdef BACKEND_8BIT
if (checkPaletteSwitch() || (bgSoundStream == NULL) ||
((_vm->_mixer->getChannelElapsedTime(bgSound) * 12) / 1000 < framenum + 1)) {