From 2aae25026dfb0818ef213de7a98652570d5362ab Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 8 Jun 2013 23:42:59 -0700 Subject: [PATCH] Forget blocking audio threads that die/release. --- Core/HLE/__sceAudio.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/HLE/__sceAudio.cpp b/Core/HLE/__sceAudio.cpp index 8dbb31c78..0325ac05e 100644 --- a/Core/HLE/__sceAudio.cpp +++ b/Core/HLE/__sceAudio.cpp @@ -207,7 +207,8 @@ inline void __AudioWakeThreads(AudioChannel &chan, int result, int step) waitInfo.numSamples -= step; // If it's done (there will still be samples on queue) and actually still waiting, wake it up. - if (waitInfo.numSamples <= 0 && __KernelGetWaitID(waitInfo.threadID, WAITTYPE_AUDIOCHANNEL, error) != 0) + u32 waitID = __KernelGetWaitID(waitInfo.threadID, WAITTYPE_AUDIOCHANNEL, error); + if (waitInfo.numSamples <= 0 && waitID != 0) { // DEBUG_LOG(HLE, "Woke thread %i for some buffer filling", waitingThread); u32 ret = result == 0 ? __KernelGetWaitValue(waitInfo.threadID, error) : SCE_ERROR_AUDIO_CHANNEL_NOT_RESERVED; @@ -215,6 +216,9 @@ inline void __AudioWakeThreads(AudioChannel &chan, int result, int step) chan.waitingThreads.erase(chan.waitingThreads.begin() + w--); } + // This means the thread stopped waiting, so stop trying to wake it. + else if (waitID == 0) + chan.waitingThreads.erase(chan.waitingThreads.begin() + w--); } }