[PATCH] xaudio2_7: Restore FAudioCreateReverbWithCustomAllocatorEXT use for old XAPO versions.

Rémi Bernon rbernon at codeweavers.com
Mon Oct 25 06:52:44 CDT 2021


This was initially guarded to check the presence of FAudioCreateReverb9*
variant and dropped in d8be85863fedf6982944d06ebd1ce5904cb3d4e1 but it
is required, and causes crackling sound after Life is Strange 2 intro.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/xaudio2_7/xapo.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/dlls/xaudio2_7/xapo.c b/dlls/xaudio2_7/xapo.c
index 657d2f3f507..47210f1570e 100644
--- a/dlls/xaudio2_7/xapo.c
+++ b/dlls/xaudio2_7/xapo.c
@@ -311,6 +311,7 @@ static inline HRESULT get_fapo_from_clsid(REFCLSID clsid, FAPO **fapo)
             XAudio_Internal_Free,
             XAudio_Internal_Realloc
         );
+#if XAUDIO2_VER >= 9
     if(IsEqualGUID(clsid, &CLSID_AudioReverb27))
         return FAudioCreateReverb9WithCustomAllocatorEXT(
             fapo,
@@ -319,6 +320,16 @@ static inline HRESULT get_fapo_from_clsid(REFCLSID clsid, FAPO **fapo)
             XAudio_Internal_Free,
             XAudio_Internal_Realloc
         );
+#else
+    if(IsEqualGUID(clsid, &CLSID_AudioReverb27))
+        return FAudioCreateReverbWithCustomAllocatorEXT(
+            fapo,
+            0,
+            XAudio_Internal_Malloc,
+            XAudio_Internal_Free,
+            XAudio_Internal_Realloc
+        );
+#endif
 #endif
 #if XAUDIO2_VER >= 8 || defined XAPOFX1_VER
     if(IsEqualGUID(clsid, &CLSID_FXReverb) ||
-- 
2.33.0




More information about the wine-devel mailing list