Skip to content

Commit

Permalink
PlatformPlayer: Do not close the custom soundfont's synth.
Browse files Browse the repository at this point in the history
This one is shared by all midi players, so closing it at any point
means that any subsequent midi will play using the default synthesizer
  • Loading branch information
AShiningRay committed Nov 22, 2024
1 parent 54519c7 commit 5f9b800
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/org/recompile/mobile/PlatformPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,12 @@ public void deallocate() { } // Prefetch does "nothing" in each internal player
public void close()
{
midi.close();
synthesizer.close();
/*
* We can't close the custom synth, otherwise any new midi files will use the
* default soundfont.
*/
if (!Manager.useCustomMidi && !Manager.hasLoadedCustomMidi) { synthesizer.close(); }

midiSequence = null;
receiver = null;
}
Expand Down

0 comments on commit 5f9b800

Please sign in to comment.