From 39c69423e38b82d50cef0f643b8c8f776c3deb64 Mon Sep 17 00:00:00 2001 From: Nunuhara Cabbage Date: Thu, 9 Dec 2021 20:28:56 -0800 Subject: [PATCH] Fix audio bug causing infinite loops in SR Fix bug where SACT2.Music_IsPlay would return true after a stream stopped playing. This was causing infinite loops in Sengoku Rance when waiting for a fade-out to complete. --- src/audio_mixer.c | 4 ++++ subprojects/libsys4 | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/audio_mixer.c b/src/audio_mixer.c index 8e5126e..ccfba7a 100644 --- a/src/audio_mixer.c +++ b/src/audio_mixer.c @@ -242,6 +242,10 @@ static int refill_stream(sts_mixer_sample_t *sample, void *data) } } + if (r == STS_STREAM_COMPLETE) { + ch->voice = -1; + } + return r; } diff --git a/subprojects/libsys4 b/subprojects/libsys4 index 5c7da33..529cd10 160000 --- a/subprojects/libsys4 +++ b/subprojects/libsys4 @@ -1 +1 @@ -Subproject commit 5c7da3373389289a363e76a9a862ce8b8d0b9aa2 +Subproject commit 529cd1053ea35a3392f908b03900edacb97ed600