mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-25 08:22:17 +00:00
Fix: [Fluidsynth] Don't try to load the default soundfont if it's not set or doesn't exist
This commit is contained in:
committed by
Peter Nelson
parent
1185f74588
commit
89cdc726c8
@@ -90,11 +90,12 @@ std::optional<std::string_view> MusicDriver_FluidSynth::Start(const StringList &
|
||||
sfont_id = FLUID_FAILED;
|
||||
|
||||
/* Try loading the default soundfont registered with FluidSynth. */
|
||||
char *default_soundfont;
|
||||
char *default_soundfont = nullptr;
|
||||
fluid_settings_dupstr(_midi.settings, "synth.default-soundfont", &default_soundfont);
|
||||
if (fluid_is_soundfont(default_soundfont)) {
|
||||
if (default_soundfont != nullptr && std::filesystem::exists(default_soundfont) && fluid_is_soundfont(default_soundfont)) {
|
||||
sfont_id = fluid_synth_sfload(_midi.synth, default_soundfont, 1);
|
||||
}
|
||||
fluid_free(default_soundfont);
|
||||
|
||||
/* If no default soundfont found, try our own list. */
|
||||
if (sfont_id == FLUID_FAILED) {
|
||||
|
||||
Reference in New Issue
Block a user