From e6a96db8a6148207dd75bd5e5f9440975c7a47e2 Mon Sep 17 00:00:00 2001 From: AShiningRay Date: Sat, 21 Oct 2023 19:13:57 -0300 Subject: [PATCH] PlatformPlayer: Only stop media playback if it is running "Orcs and Elves" constantly tries to stop a MIDI stream that isn't even running, and ends up causing a stack overflow on PlatformPlayer. Since it only makes sense to stop streams that are actually running, add a check for cases where they aren't. --- src/org/recompile/mobile/PlatformPlayer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/org/recompile/mobile/PlatformPlayer.java b/src/org/recompile/mobile/PlatformPlayer.java index 960abb56..f979f11d 100644 --- a/src/org/recompile/mobile/PlatformPlayer.java +++ b/src/org/recompile/mobile/PlatformPlayer.java @@ -238,6 +238,7 @@ public void start() public void stop() { + if(!isRunning()) { return; } midi.stop(); state = Player.PREFETCHED; tick = midi.getTickPosition(); @@ -341,6 +342,7 @@ public void start() public void stop() { + if(!isRunning()) { return; } wavClip.stop(); time = wavClip.getMicrosecondPosition(); state = Player.PREFETCHED;