From c02ee9a50283088eb490b401999937ad99ff84be Mon Sep 17 00:00:00 2001
From: Steel Titanium <steeltitanium1@gmail.com>
Date: Sat, 28 Jul 2018 01:58:25 -0400
Subject: [PATCH] Re-did this fix.

---
 src/sdl/mixer_sound.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c
index 18670649e6..7ab1523c6e 100644
--- a/src/sdl/mixer_sound.c
+++ b/src/sdl/mixer_sound.c
@@ -66,6 +66,7 @@ static boolean midimode;
 static Mix_Music *music;
 static UINT8 music_volume, midi_volume, sfx_volume;
 static float loop_point;
+static boolean songpaused;
 
 #ifdef HAVE_LIBGME
 static Music_Emu *gme;
@@ -102,6 +103,7 @@ void I_StartupSound(void)
 	}
 
 	sound_started = true;
+	songpaused = false;
 	Mix_AllocateChannels(256);
 }
 
@@ -450,7 +452,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
 	(void)udata;
 
 	// no gme? no music.
-	if (!gme || gme_track_ended(gme))
+	if (!gme || gme_track_ended(gme) || songpaused)
 		return;
 
 	// play gme into stream
@@ -475,25 +477,15 @@ void I_ShutdownMusic(void)
 void I_PauseSong(INT32 handle)
 {
 	(void)handle;
-#ifdef HAVE_LIBGME
-	if (gme)
-	{
-		Mix_HookMusic(NULL, NULL);
-	}
-#endif
 	Mix_PauseMusic();
+	songpaused = true;
 }
 
 void I_ResumeSong(INT32 handle)
 {
 	(void)handle;
-#ifdef HAVE_LIBGME
-	if (gme)
-	{
-		Mix_HookMusic(mix_gme, gme);
-	}
-#endif
 	Mix_ResumeMusic();
+	songpaused = false;
 }
 
 //
-- 
GitLab