SDL_mixer: Don't wait for the music to fade out in Mix_FreeMusic if it is inactive

From f4a95287b371cfb43851bdea4ec9c740bf8df0a5 Mon Sep 17 00:00:00 2001
From: Nathan Houghton <[EMAIL REDACTED]>
Date: Sun, 5 Jun 2022 14:15:34 -0700
Subject: [PATCH] Don't wait for the music to fade out in Mix_FreeMusic if it
 is inactive

---
 src/music.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/music.c b/src/music.c
index 3e5407af..86700bde 100644
--- a/src/music.c
+++ b/src/music.c
@@ -739,7 +739,7 @@ void Mix_FreeMusic(Mix_Music *music)
         Mix_LockAudio();
         if (music == music_playing) {
             /* Wait for any fade out to finish */
-            while (music->fading == MIX_FADING_OUT) {
+            while (music_active && music->fading == MIX_FADING_OUT) {
                 Mix_UnlockAudio();
                 SDL_Delay(100);
                 Mix_LockAudio();