[Scummvm-git-logs] scummvm master -> 58a77abded5d724d99a56b1873d8571e8e847ab4

sev- sev at scummvm.org
Wed Sep 2 08:01:37 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
58a77abded FLUIDSYNTH: Prefer in-memory SoundFont data over global setting


Commit: 58a77abded5d724d99a56b1873d8571e8e847ab4
    https://github.com/scummvm/scummvm/commit/58a77abded5d724d99a56b1873d8571e8e847ab4
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2020-09-02T10:01:33+02:00

Commit Message:
FLUIDSYNTH: Prefer in-memory SoundFont data over global setting

When an engine provides in-memory SoundFont data, use that unless a
SoundFont has been explicitly configured on the current game. Otherwise
a global SoundFont setting will always override it. Even overriding the
MIDI settings for the game and leaving the SoundFont setting blank did
not work for me.

Changed paths:
    audio/softsynth/fluidsynth.cpp


diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp
index 5efa006253..e0d7c4e3df 100644
--- a/audio/softsynth/fluidsynth.cpp
+++ b/audio/softsynth/fluidsynth.cpp
@@ -167,7 +167,9 @@ int MidiDriver_FluidSynth::open() {
 		return MERR_ALREADY_OPEN;
 
 #if defined(FLUIDSYNTH_VERSION_MAJOR) && FLUIDSYNTH_VERSION_MAJOR > 1
-	bool isUsingInMemorySoundFontData = _engineSoundFontData && !ConfMan.hasKey("soundfont");
+	// When provided with in-memory SoundFont data, only use the configured
+	// SoundFont instead if it's explicitly configured on the current game.
+	bool isUsingInMemorySoundFontData = _engineSoundFontData && !ConfMan.getActiveDomain()->contains("soundfont");
 #else
 	bool isUsingInMemorySoundFontData = false;
 #endif
@@ -241,7 +243,7 @@ int MidiDriver_FluidSynth::open() {
 
 	fluid_synth_set_interp_method(_synth, -1, interpMethod);
 
-	const char *soundfont = ConfMan.hasKey("soundfont") ?
+	const char *soundfont = !isUsingInMemorySoundFontData ?
 			ConfMan.get("soundfont").c_str() : Common::String::format("&%p", (void *)_engineSoundFontData).c_str();
 
 #if defined(FLUIDSYNTH_VERSION_MAJOR) && FLUIDSYNTH_VERSION_MAJOR > 1




More information about the Scummvm-git-logs mailing list