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

Signed-off-by: Ethan Lee <elee@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ethan Lee 2019-05-23 13:01:31 -04:00 committed by Alexandre Julliard
parent a55a287cab
commit d341efeff0
5 changed files with 38 additions and 1 deletions

17
configure vendored
View File

@ -14966,6 +14966,23 @@ CPPFLAGS=$ac_save_CPPFLAGS
test -z "$FAUDIO_CFLAGS" || FAUDIO_CFLAGS=`echo " $FAUDIO_CFLAGS" | sed 's/ -I\([^/]\)/ -I\$(top_builddir)\/\1/g'`
test -z "$FAUDIO_LIBS" || FAUDIO_LIBS=`echo " $FAUDIO_LIBS" | sed 's/ -L\([^/]\)/ -L\$(top_builddir)\/\1/g'`
ac_wine_check_funcs_save_LIBS="$LIBS"
LIBS="$LIBS $FAUDIO_LIBS"
for ac_func in \
FAudio_CommitOperationSet \
F3DAudioInitialize8
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"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
LIBS="$ac_wine_check_funcs_save_LIBS"
fi
if test "x$ac_cv_lib_soname_FAudio" = "x"; then :
case "x$with_faudio" in

View File

@ -1690,6 +1690,10 @@ then
WINE_PACKAGE_FLAGS(FAUDIO,[faudio],[-lFAudio],,,
[AC_CHECK_HEADERS([FAudio.h],
[WINE_CHECK_SONAME(FAudio,FAudioCreate,,,[$FAUDIO_LIBS],[[libFAudio*]])])])
WINE_CHECK_LIB_FUNCS(\
FAudio_CommitOperationSet \
F3DAudioInitialize8,
[$FAUDIO_LIBS])
fi
WINE_NOTICE_WITH(faudio,[test "x$ac_cv_lib_soname_FAudio" = "x"],
[libFAudio ${notice_platform}development files not found, XAudio2 won't be supported.])

View File

@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include "windef.h"
@ -51,8 +53,12 @@ HRESULT CDECL X3DAudioInitialize(UINT32 chanmask, float speedofsound,
X3DAUDIO_HANDLE handle)
{
TRACE("0x%x, %f, %p\n", chanmask, speedofsound, handle);
#ifdef HAVE_F3DAUDIOINITIALIZE8
return F3DAudioInitialize8(chanmask, speedofsound, handle);
#else
F3DAudioInitialize(chanmask, speedofsound, handle);
return S_OK;
#endif
}
#endif /* XAUDIO2_VER >= 8 */

View File

@ -1797,9 +1797,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);
#ifdef HAVE_FAUDIO_COMMITOPERATIONSET
return FAudio_CommitOperationSet(This->faudio, operationSet);
#else
return FAudio_CommitChanges(This->faudio);
#endif
}
static void WINAPI IXAudio2Impl_GetPerformanceData(IXAudio2 *iface,

View File

@ -146,9 +146,15 @@
/* Define to 1 if you have the `expm1f' function. */
#undef HAVE_EXPM1F
/* Define to 1 if you have the `F3DAudioInitialize8' function. */
#undef HAVE_F3DAUDIOINITIALIZE8
/* Define to 1 if you have the `fallocate' function. */
#undef HAVE_FALLOCATE
/* Define to 1 if you have the `FAudio_CommitOperationSet' function. */
#undef HAVE_FAUDIO_COMMITOPERATIONSET
/* Define to 1 if you have the <FAudio.h> header file. */
#undef HAVE_FAUDIO_H