[PATCH 1/2] xaudio2: Fix support for FAudio 19.06 and newer

elee at codeweavers.com elee at codeweavers.com
Wed May 1 10:46:24 CDT 2019


From: Ethan Lee <elee at codeweavers.com>

Signed-off-by: Ethan Lee <elee at codeweavers.com>
---
 dlls/xaudio2_7/x3daudio.c   | 4 ++++
 dlls/xaudio2_7/xapo.c       | 2 ++
 dlls/xaudio2_7/xaudio_dll.c | 6 +++++-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/dlls/xaudio2_7/x3daudio.c b/dlls/xaudio2_7/x3daudio.c
index ee3367e092..f08a425ca1 100644
--- a/dlls/xaudio2_7/x3daudio.c
+++ b/dlls/xaudio2_7/x3daudio.c
@@ -51,8 +51,12 @@ HRESULT CDECL X3DAudioInitialize(UINT32 chanmask, float speedofsound,
         X3DAUDIO_HANDLE handle)
 {
     TRACE("0x%x, %f, %p\n", chanmask, speedofsound, handle);
+#if FAUDIO_ABI_VERSION >= 1
+    return F3DAudioInitialize8(chanmask, speedofsound, handle);
+#else
     F3DAudioInitialize(chanmask, speedofsound, handle);
     return S_OK;
+#endif
 }
 #endif /* XAUDIO2_VER >= 8 */
 
diff --git a/dlls/xaudio2_7/xapo.c b/dlls/xaudio2_7/xapo.c
index 9788cb38e8..0b2a5932a5 100644
--- a/dlls/xaudio2_7/xapo.c
+++ b/dlls/xaudio2_7/xapo.c
@@ -330,8 +330,10 @@ static inline HRESULT get_fapo_from_clsid(REFCLSID clsid, FAPO **fapo)
         return FAPOFX_CreateFXWithCustomAllocatorEXT(
             (const FAudioGUID*) clsid,
             fapo,
+#if FAUDIO_ABI_VERSION < 1
             NULL,
             0,
+#endif
             XAudio_Internal_Malloc,
             XAudio_Internal_Free,
             XAudio_Internal_Realloc
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c
index cbbedc4f7f..0f7ae36e66 100644
--- a/dlls/xaudio2_7/xaudio_dll.c
+++ b/dlls/xaudio2_7/xaudio_dll.c
@@ -1796,9 +1796,13 @@ static HRESULT WINAPI IXAudio2Impl_CommitChanges(IXAudio2 *iface,
 {
     IXAudio2Impl *This = impl_from_IXAudio2(iface);
 
-    TRACE("(%p)->(0x%x): stub!\n", This, operationSet);
+    TRACE("(%p)->(0x%x)\n", This, operationSet);
 
+#if FAUDIO_ABI_VERSION >= 1
+    return FAudio_CommitChanges(This->faudio, operationSet);
+#else
     return FAudio_CommitChanges(This->faudio);
+#endif
 }
 
 static void WINAPI IXAudio2Impl_GetPerformanceData(IXAudio2 *iface,
-- 
2.21.0




More information about the wine-devel mailing list