From e6bba2473782eeb353a6778c21180cf477341c8f Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 17 Dec 2022 13:16:28 +0000 Subject: [PATCH] Disable MVE mixer when movie ends The global variables that control it configure the callback to do nothing, but SDL_mixer would still call it and still acquire the SDL mutex that protects the call. Such calls are a waste, so disable them. This should also fix , which appears to be caused by the MVE mixer callback being run during gameplay, and the callback not returning immediately. This is suspected to be because a race condition between MVE_rmEndMovie and the callback caused the global variables not to be placed in a state that causes the callback to return immediately. --- d2x-rebirth/libmve/mveplay.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/d2x-rebirth/libmve/mveplay.cpp b/d2x-rebirth/libmve/mveplay.cpp index 1466f4f41..cff053ee2 100644 --- a/d2x-rebirth/libmve/mveplay.cpp +++ b/d2x-rebirth/libmve/mveplay.cpp @@ -746,6 +746,10 @@ void MVE_rmEndMovie(std::unique_ptr) { SDL_CloseAudio(); } +#if DXX_USE_SDLMIXER + else + Mix_SetPostMix(nullptr, nullptr); +#endif mve_audio_canplay = 0; } mve_audio_buffers = {};