lock audio stream in I_PlaySong

seems to fix weird crashes with gme
This commit is contained in:
Alug committed 2025-12-01 02:03:19 +01:00
1 parent ca9b0147b2
commit 6f242f30e1
1 file changed
+5
+5
View File
@@ -1550,6 +1550,7 @@ void I_UnloadSong(void)
boolean I_PlaySong(boolean looping)
{
SDL_LockAudioStream(audio_stream);
#ifdef HAVE_LIBGME
if (gme)
{
@@ -1593,10 +1594,14 @@ boolean I_PlaySong(boolean looping)
else
#endif
if (music_stream == NULL)
{
SDL_UnlockAudioStream(audio_stream);
return false;
}
loop_song = looping;
song_paused = false;
SDL_UnlockAudioStream(audio_stream);
return true;
}