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

From 3a4cdce6dca7413fc37bf5f6d81cd53d3b54e9d7 Mon Sep 17 00:00:00 2001
From: Nathan Houghton <[EMAIL REDACTED]>
Date: Mon, 6 Jun 2022 23:51:04 +0300
Subject: [PATCH] Don't wait for the music to fade out in Mix_FreeMusic if it
 is inactive

backported from main branch commit f4a95287b371cfb43851bdea4ec9c740bf8df0a5
https://github.com/libsdl-org/SDL_mixer/pull/405
---
 music.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/music.c b/music.c
index 8fe8eca2..0369139a 100644
--- a/music.c
+++ b/music.c
@@ -751,7 +751,7 @@ void Mix_FreeMusic(Mix_Music *music)
 		SDL_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 ) {
 				SDL_UnlockAudio();
 				SDL_Delay(100);
 				SDL_LockAudio();