From 349d4eba2b0da397fb5b47452615318f6fc6925a Mon Sep 17 00:00:00 2001 From: The Dax Date: Sat, 27 Jul 2013 00:38:42 -0400 Subject: [PATCH 1/2] 64-bit PPSSPP(Windows): Attempt to fix games that crash with Atrac3plusdecoder64.dll. It seems to be caused by m_audiocontext being null.. --- Core/HW/MediaEngine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Core/HW/MediaEngine.cpp b/Core/HW/MediaEngine.cpp index 17c3f542f3..6de39474cc 100644 --- a/Core/HW/MediaEngine.cpp +++ b/Core/HW/MediaEngine.cpp @@ -589,7 +589,10 @@ int MediaEngine::getAudioSamples(u8* buffer) { return 0; } int outbytes = 0; - Atrac3plus_Decoder::Decode(m_audioContext, audioFrame, frameSize, &outbytes, buffer); + + if(m_audioContext != nullptr) + Atrac3plus_Decoder::Decode(m_audioContext, audioFrame, frameSize, &outbytes, buffer); + if (headerCode1 == 0x24) { // it a mono atrac3plus, convert it to stereo s16 *outbuf = (s16*)buffer; From 489748ffc08ac86dfd8683a3ef6c0c3f8ea73904 Mon Sep 17 00:00:00 2001 From: The Dax Date: Sat, 27 Jul 2013 02:16:06 -0400 Subject: [PATCH 2/2] Change nullptr to NULL to avoid possible issues with platforms that don't support C++11. --- Core/HW/MediaEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/HW/MediaEngine.cpp b/Core/HW/MediaEngine.cpp index 6de39474cc..4dd07f146e 100644 --- a/Core/HW/MediaEngine.cpp +++ b/Core/HW/MediaEngine.cpp @@ -590,7 +590,7 @@ int MediaEngine::getAudioSamples(u8* buffer) { } int outbytes = 0; - if(m_audioContext != nullptr) + if(m_audioContext != NULL) Atrac3plus_Decoder::Decode(m_audioContext, audioFrame, frameSize, &outbytes, buffer); if (headerCode1 == 0x24) {