shithub: choc

Download patch

ref: 670212f2ee7c468790c3e3b351b45135c274ef9c
parent: 6a299e2f0245d2b33fc5558c99bbf8f764e6dfda
parent: 3c44a45bb5f24d71ddc98627b3a1de4797b058af
author: Simon Howard <fraggle@soulsphere.org>
date: Mon May 4 07:28:51 EDT 2020

Merge pull request #1280 from chocolate-doom/fluidsynth-fix

music: Disable Fluidsynth when we want Timidity.

--- a/src/i_sdlmusic.c
+++ b/src/i_sdlmusic.c
@@ -110,11 +110,17 @@
 
     // Set the TIMIDITY_CFG environment variable to point to the temporary
     // config file.
-
     if (success)
     {
         env_string = M_StringJoin("TIMIDITY_CFG=", temp_timidity_cfg, NULL);
         putenv(env_string);
+        // env_string deliberately not freed; see putenv manpage
+
+        // If we're explicitly configured to use Timidity (either through
+        // timidity_cfg_path or GUS mode), then disable Fluidsynth, because
+        // SDL_mixer considers Fluidsynth a higher priority than Timidity and
+        // therefore can end up circumventing Timidity entirely.
+        putenv("SDL_MIXER_DISABLE_FLUIDSYNTH=1");
     }
     else
     {