-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Midi: Properly shutdown and reinitialize #3092
Conversation
This way they are destroyed when the DisplayUi is destroyed instead of when the process terminates. Fixes a use-after-free in the Fluidsynth Decoder. Fix EasyRPG#3015 Fix EasyRPG#3035 Fix EasyRPG#3079
@@ -22,31 +22,20 @@ | |||
#include <memory> | |||
#include "audio_decoder_midi.h" | |||
#include "audio_generic.h" | |||
#include "audio_generic_midiout.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7269d32 breaks compilation with for platforms libretro, psvita, sdl and switch when compiling audio.o because they include audio_generic.h
. Since this commit, said header includes audio_generic_midiout.h
which does not provide a definition for AudioDecoderMidi
itself.
This used to be no problem because audio_generic_midiout.h
was only included from audio_generic.cpp
which also includes the missing header.
The fix is to include audio_decoder_midi.h
either in audio_generic.h
or in audio_generic_midiout.h
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++ Header mess :/. Thanks for testing this!
src/audio_generic.cpp
Outdated
@@ -22,31 +22,20 @@ | |||
#include <memory> | |||
#include "audio_decoder_midi.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be deleted if you move audio_generic_midiout.h
(see next comment).
5bb2a26
to
c61fb42
Compare
Now custom soundfonts are always loaded when switching the game instead of only the first time. Fix EasyRPG#2916
c61fb42
to
2edb217
Compare
First commit fixes an oversight in the shutdown logic of the Player: Most audio stuff was not deleted because they were static variables...
This fixes the fluidsynth crashes on shutdown.
Should also fix the libretro crash when playing a second game but I havn't tested this (yet).
Second commit is less serious: Fluidsynth and WildMidi are now reinitialized when loading a second game. This saves RAM (unloaded when not used by the game) and allows per-game soundfonts. Before only the first was loaded.