Rémi Bernon : xaudio2_9: Use new FAudioCreateReverb9 interface.

Alexandre Julliard julliard at winehq.org
Mon Aug 10 16:16:30 CDT 2020


Module: wine
Branch: master
Commit: 196cb7afef48f717794828b3ac00838c7aa013c8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=196cb7afef48f717794828b3ac00838c7aa013c8

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Wed Aug  5 09:08:10 2020 +0200

xaudio2_9: Use new FAudioCreateReverb9 interface.

XAudio 2.9 and Windows 10 introduced a new SideDelay field in the middle
of the XAUDIO2FX_REVERB_PARAMETERS structure, which causes other fields
to be offseted and incorrectly read from the parameter buffer.

FAudio 20.08 introduces this new interface to create reverb effects that
use the new parameter structure layout.

This fixes audio glitches in Dragon Quest Builders 2.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure             |  3 ++-
 configure.ac          |  3 ++-
 dlls/xaudio2_7/xapo.c | 11 +++++++++++
 include/config.h.in   |  4 ++++
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index c9afbc0ab8..ffe5ecca89 100755
--- a/configure
+++ b/configure
@@ -15531,7 +15531,8 @@ done
 LIBS="$LIBS $FAUDIO_LIBS"
 for ac_func in FAudio_CommitOperationSet \
                                    F3DAudioInitialize8 \
-                                   FAudioLinkedVersion
+                                   FAudioLinkedVersion \
+                                   FAudioCreateReverb9WithCustomAllocatorEXT
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/configure.ac b/configure.ac
index 360ef2b11f..67729e0c0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1784,7 +1784,8 @@ then
             [WINE_CHECK_SONAME(FAudio,FAudioCreate,,,[$FAUDIO_LIBS],[[libFAudio*]])])
              WINE_CHECK_LIB_FUNCS([FAudio_CommitOperationSet \
                                    F3DAudioInitialize8 \
-                                   FAudioLinkedVersion], [$FAUDIO_LIBS])
+                                   FAudioLinkedVersion \
+                                   FAudioCreateReverb9WithCustomAllocatorEXT], [$FAUDIO_LIBS])
             ])
 fi
 WINE_NOTICE_WITH(faudio,[test "x$ac_cv_lib_soname_FAudio" = "x"],
diff --git a/dlls/xaudio2_7/xapo.c b/dlls/xaudio2_7/xapo.c
index e64523ea19..e47442959d 100644
--- a/dlls/xaudio2_7/xapo.c
+++ b/dlls/xaudio2_7/xapo.c
@@ -313,6 +313,16 @@ static inline HRESULT get_fapo_from_clsid(REFCLSID clsid, FAPO **fapo)
             XAudio_Internal_Free,
             XAudio_Internal_Realloc
         );
+#if XAUDIO2_VER >= 9 && HAVE_FAUDIOCREATEREVERB9WITHCUSTOMALLOCATOREXT
+    if(IsEqualGUID(clsid, &CLSID_AudioReverb27))
+        return FAudioCreateReverb9WithCustomAllocatorEXT(
+            fapo,
+            0,
+            XAudio_Internal_Malloc,
+            XAudio_Internal_Free,
+            XAudio_Internal_Realloc
+        );
+#else
     if(IsEqualGUID(clsid, &CLSID_AudioReverb27))
         return FAudioCreateReverbWithCustomAllocatorEXT(
             fapo,
@@ -322,6 +332,7 @@ static inline HRESULT get_fapo_from_clsid(REFCLSID clsid, FAPO **fapo)
             XAudio_Internal_Realloc
         );
 #endif
+#endif
 #if XAUDIO2_VER >= 8 || defined XAPOFX1_VER
     if(IsEqualGUID(clsid, &CLSID_FXReverb) ||
             IsEqualGUID(clsid, &CLSID_FXEQ) ||
diff --git a/include/config.h.in b/include/config.h.in
index fc9305418c..1748a8b8d8 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -152,6 +152,10 @@
 /* Define to 1 if you have the `fallocate' function. */
 #undef HAVE_FALLOCATE
 
+/* Define to 1 if you have the `FAudioCreateReverb9WithCustomAllocatorEXT'
+   function. */
+#undef HAVE_FAUDIOCREATEREVERB9WITHCUSTOMALLOCATOREXT
+
 /* Define to 1 if you have the `FAudioLinkedVersion' function. */
 #undef HAVE_FAUDIOLINKEDVERSION
 




More information about the wine-cvs mailing list