SDL_mixer: decoder_timidity, init: React to TIMIDITY_SOUNDFONT environment variable

From a2e90fb7b570bb202ca45f82a6695b83aae99f87 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Fri, 31 Jul 2026 23:55:02 +0300
Subject: [PATCH] decoder_timidity, init: React to TIMIDITY_SOUNDFONT
 environment variable

---
 src/decoder_timidity.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/decoder_timidity.c b/src/decoder_timidity.c
index 54f4cff3..edde28e9 100644
--- a/src/decoder_timidity.c
+++ b/src/decoder_timidity.c
@@ -46,6 +46,11 @@ typedef struct TIMIDITY_TrackData
 
 static bool SDLCALL TIMIDITY_init(void)
 {
+    const char *sf2 = SDL_getenv("TIMIDITY_SOUNDFONT");
+    if (sf2) {
+        Timidity_SetSoundfont(sf2); // user override, no cfg
+    }
+
     const char *cfg = SDL_getenv("TIMIDITY_CFG");  // see if the user had one.
     if (cfg) {
         return (Timidity_Init(cfg) == 0); // env or user override: no other tries