From 03a20820cb638057ee3906593d04889928796865 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Tue, 15 Aug 2017 15:30:27 -0700 Subject: [PATCH] temp fix for deadlocks in SoundSDL on pause #139 SDL_PauseAudioDevice seems to be causing thread deadlocks in combination with Wx threads (e.g. on menu activation or modal dialogs.) Remove these calls from SoundSDL::pause() and SoundSDL::resume() for the time being so that deadlocks do not happen. This effectively allows pausing, but on resume there is no sound for 2-3 seconds until the buffer is filled again. This will need a proper fix at a later time. --- src/common/SoundSDL.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/SoundSDL.cpp b/src/common/SoundSDL.cpp index 4163aff1..db8672ac 100644 --- a/src/common/SoundSDL.cpp +++ b/src/common/SoundSDL.cpp @@ -175,7 +175,7 @@ void SoundSDL::pause() if (!_initialized) return; - SDL_PauseAudioDevice(_dev, 1); + //SDL_PauseAudioDevice(_dev, 1); // this causes thread deadlocks } void SoundSDL::resume() @@ -183,7 +183,7 @@ void SoundSDL::resume() if (!_initialized) return; - SDL_PauseAudioDevice(_dev, 0); + //SDL_PauseAudioDevice(_dev, 0); // this causes thread deadlocks } void SoundSDL::reset()