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@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2020-08-05 09:08:10 +02:00 committed by Alexandre Julliard
parent b900567f04
commit 196cb7afef
4 changed files with 19 additions and 2 deletions

3
configure vendored
View File

@ -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"

View File

@ -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"],

View File

@ -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) ||

View File

@ -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