foxygit / doom Log in
commit 9ab44a4fec763add09ca77df0e57da99928c4054
Author:     James Haley <haleyjd@hotmail.com>
AuthorDate: Fri Aug 26 00:22:55 2016 -0500
Commit:     James Haley <haleyjd@hotmail.com>
CommitDate: Fri Aug 26 00:22:55 2016 -0500

    Mix_HaltChannel must always be called when releasing a sound. Fixes #773.
---
 src/i_sdlsound.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/i_sdlsound.c b/src/i_sdlsound.c
index 6896330d..e97d11a9 100644
--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -348,6 +348,9 @@ static void ReleaseSoundOnChannel(int channel)
         return;
     }

+    // DEBUG
+    Mix_HaltChannel(channel);
+
     channels_playing[channel] = NULL;

     UnlockAllocatedSound(snd);
@@ -996,8 +999,6 @@ static void I_SDL_StopSound(int handle)
         return;
     }

-    Mix_HaltChannel(handle);
-
     // Sound data is no longer needed; release the
     // sound data being used for this channel