[PATCH] xaudio2: Use new features from FAudio 19.06 (but keep compatibility for <=19.05)

elee at codeweavers.com elee at codeweavers.com
Wed May 22 10:19:10 CDT 2019


From: Ethan Lee <elee at codeweavers.com>

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

diff --git a/dlls/xaudio2_7/x3daudio.c b/dlls/xaudio2_7/x3daudio.c
index ee3367e092..51e8029fcd 100644
--- a/dlls/xaudio2_7/x3daudio.c
+++ b/dlls/xaudio2_7/x3daudio.c
@@ -25,6 +25,7 @@
 
 #include "wine/debug.h"
 
+#include <FAudio.h> /* For version information */
 #include <F3DAudio.h>
 
 #if XAUDIO2_VER >= 8 || defined X3DAUDIO1_VER
@@ -51,8 +52,12 @@ HRESULT CDECL X3DAudioInitialize(UINT32 chanmask, float speedofsound,
         X3DAUDIO_HANDLE handle)
 {
     TRACE("0x%x, %f, %p\n", chanmask, speedofsound, handle);
+#if FAUDIO_COMPILED_VERSION >= 190600
+    return F3DAudioInitialize8(chanmask, speedofsound, handle);
+#else
     F3DAudioInitialize(chanmask, speedofsound, handle);
     return S_OK;
+#endif
 }
 #endif /* XAUDIO2_VER >= 8 */
 
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c
index da21cc0353..371666991c 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_COMPILED_VERSION >= 190600
+    return FAudio_CommitOperationSet(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