From 87cd1b9ddba64ef2e05a5132943020b172e6bc9f Mon Sep 17 00:00:00 2001 From: Alexis He Date: Wed, 18 Aug 2021 08:35:57 +0200 Subject: [PATCH 2/2] Fix: Simplify fluidsynth exception case for Android --- music/fluidsynth.cc | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/music/fluidsynth.cc b/music/fluidsynth.cc index 2f6160bea..7914e509f 100644 --- a/music/fluidsynth.cc +++ b/music/fluidsynth.cc @@ -173,7 +173,7 @@ bool dr_load_sf(const char * filename){ return false; } -#ifndef __ANDROID__ + static void fluid_log(int level, const char *message, void *) { switch (level) { @@ -184,26 +184,11 @@ static void fluid_log(int level, const char *message, void *) case FLUID_DBG: dbg->debug("FluidSynth", "%s", message); break; } } -#endif bool dr_init_midi() { -#ifdef __ANDROID__ - if( !(settings = new_fluid_settings()) ) { - dbg->warning( "dr_init_midi()", "FluidSynth: MIDI settings failed." ); - return false; - } - - std::string fluidsynth_driver = "sdl2"; - - if( !SDL_WasInit( SDL_INIT_AUDIO ) ) { - if( SDL_InitSubSystem( SDL_INIT_AUDIO ) != 0 ) { - dbg->warning( "dr_init_midi()", "FluidSynth: SDL_INIT_AUDIO failed." ); - return false; - } - } -#else +#ifndef __ANDROID__ fluid_set_log_function(FLUID_PANIC, fluid_log, NULL); fluid_set_log_function(FLUID_ERR, fluid_log, NULL); fluid_set_log_function(FLUID_WARN, fluid_log, NULL); @@ -230,7 +215,6 @@ bool dr_init_midi() dbg->warning("dr_init_midi()", "FluidSynth: MIDI settings failed."); return false; } -#endif fluid_settings_setint( settings, "synth.cpu-cores", env_t::num_threads ); fluid_settings_setstr( settings, "synth.midi-bank-select", "gm" ); -- 2.28.0.windows.1