Use FAudio library now

This commit is contained in:
Alistair Leslie-Hughes 2019-07-15 09:35:57 +10:00
parent 8d19b3fc4b
commit b95b9109b8
20 changed files with 0 additions and 10109 deletions

View File

@ -373,10 +373,6 @@ patch_enable_all ()
enable_wtsapi32_EnumerateProcesses="$1"
enable_wuauserv_Dummy_Service="$1"
enable_wusa_MSU_Package_Installer="$1"
enable_xaudio2_revert="$1"
enable_xaudio2_7_CreateFX_FXEcho="$1"
enable_xaudio2_7_WMA_support="$1"
enable_xaudio2_CommitChanges="$1"
}
# Enable or disable a specific patchset
@ -1253,18 +1249,6 @@ patch_enable ()
wusa-MSU_Package_Installer)
enable_wusa_MSU_Package_Installer="$2"
;;
xaudio2-revert)
enable_xaudio2_revert="$2"
;;
xaudio2_7-CreateFX-FXEcho)
enable_xaudio2_7_CreateFX_FXEcho="$2"
;;
xaudio2_7-WMA_support)
enable_xaudio2_7_WMA_support="$2"
;;
xaudio2_CommitChanges)
enable_xaudio2_CommitChanges="$2"
;;
*)
return 1
;;
@ -1620,27 +1604,6 @@ patch_apply()
}
if test "$enable_xaudio2_CommitChanges" -eq 1; then
if test "$enable_xaudio2_revert" -gt 1; then
abort "Patchset xaudio2-revert disabled, but xaudio2_CommitChanges depends on that."
fi
enable_xaudio2_revert=1
fi
if test "$enable_xaudio2_7_WMA_support" -eq 1; then
if test "$enable_xaudio2_revert" -gt 1; then
abort "Patchset xaudio2-revert disabled, but xaudio2_7-WMA_support depends on that."
fi
enable_xaudio2_revert=1
fi
if test "$enable_xaudio2_7_CreateFX_FXEcho" -eq 1; then
if test "$enable_xaudio2_revert" -gt 1; then
abort "Patchset xaudio2-revert disabled, but xaudio2_7-CreateFX-FXEcho depends on that."
fi
enable_xaudio2_revert=1
fi
if test "$enable_ws2_32_TransmitFile" -eq 1; then
if test "$enable_server_Desktop_Refcount" -gt 1; then
abort "Patchset server-Desktop_Refcount disabled, but ws2_32-TransmitFile depends on that."
@ -7544,109 +7507,6 @@ if test "$enable_wusa_MSU_Package_Installer" -eq 1; then
) >> "$patchlist"
fi
# Patchset xaudio2-revert
# |
# | Modified files:
# | * configure, configure.ac, dlls/x3daudio1_0/Makefile.in, dlls/x3daudio1_1/Makefile.in, dlls/x3daudio1_2/Makefile.in,
# | dlls/x3daudio1_3/Makefile.in, dlls/x3daudio1_4/Makefile.in, dlls/x3daudio1_5/Makefile.in, dlls/x3daudio1_6/Makefile.in,
# | dlls/x3daudio1_7/Makefile.in, dlls/xapofx1_1/Makefile.in, dlls/xapofx1_2/Makefile.in, dlls/xapofx1_3/Makefile.in,
# | dlls/xapofx1_4/Makefile.in, dlls/xapofx1_5/Makefile.in, dlls/xaudio2_0/Makefile.in, dlls/xaudio2_1/Makefile.in,
# | dlls/xaudio2_2/Makefile.in, dlls/xaudio2_3/Makefile.in, dlls/xaudio2_4/Makefile.in, dlls/xaudio2_5/Makefile.in,
# | dlls/xaudio2_6/Makefile.in, dlls/xaudio2_7/Makefile.in, dlls/xaudio2_7/compat.c, dlls/xaudio2_7/tests/xaudio2.c,
# | dlls/xaudio2_7/x3daudio.c, dlls/xaudio2_7/xapo.c, dlls/xaudio2_7/xapofx.c, dlls/xaudio2_7/xaudio_allocator.c,
# | dlls/xaudio2_7/xaudio_classes.idl, dlls/xaudio2_7/xaudio_dll.c, dlls/xaudio2_7/xaudio_private.h,
# | dlls/xaudio2_8/Makefile.in, dlls/xaudio2_8/xaudio2_8.spec, dlls/xaudio2_9/Makefile.in, dlls/xaudio2_9/xaudio2_9.spec,
# | include/config.h.in, include/xapo.idl, include/xaudio2.idl
# |
if test "$enable_xaudio2_revert" -eq 1; then
patch_apply xaudio2-revert/0001-Revert-xaudio2-Export-functions-by-ordinal.patch
patch_apply xaudio2-revert/0002-Revert-xaudio2-Add-TRACE-functions-to-CreateAudioRev.patch
patch_apply xaudio2-revert/0003-Revert-xaudio2-Fix-some-TRACE-calls-erroneously-mark.patch
patch_apply xaudio2-revert/0004-Revert-xaudio2-Use-new-features-from-FAudio-19.06-bu.patch
patch_apply xaudio2-revert/0005-Revert-xaudio2-Fix-32-bit-build.patch
patch_apply xaudio2-revert/0006-Revert-xaudio2_7-tests-Remove-redundant-not-NULL-che.patch
patch_apply xaudio2-revert/0007-Revert-xaudio2_7-Add-a-trailing-n-to-an-ERR-message.patch
patch_apply xaudio2-revert/0008-Revert-xaudio2-IXAPO-Process-out-parameter-should-no.patch
patch_apply xaudio2-revert/0009-Revert-xaudio2-IXAudio23-needs-its-own-interface-for.patch
patch_apply xaudio2-revert/0010-Revert-xaudio2-Fix-uninitialized-variable-access-Val.patch
patch_apply xaudio2-revert/0011-Revert-xaudio2-Rewrite-to-use-FAudio.patch
patch_apply xaudio2-revert/0012-xaudio2_7-Fix-build.patch
(
printf '%s\n' '+ { "Alistair Leslie-Hughes", "Revert \"xaudio2: Export functions by ordinal.\".", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "Revert \"xaudio2: Add TRACE functions to CreateAudioReverb/CreateAudioVolumeMeter.\".", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "Revert \"xaudio2: Fix some TRACE calls erroneously marked as stubs.\".", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "Revert \"xaudio2: Use new features from FAudio 19.06 (but keep compatibility for <=19.05).\".", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "Revert \"xaudio2: Fix 32-bit build.\".", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "Revert \"xaudio2_7/tests: Remove redundant not-NULL checks (coccinellery).\".", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "Revert \"xaudio2_7: Add a trailing '\''\\n'\'' to an ERR() message.\".", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "Revert \"xaudio2: IXAPO::Process out parameter should not be const.\".", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "Revert \"xaudio2: IXAudio23 needs its own interface, for XAUDIO23_VOICE_SENDS parameters.\".", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "Revert \"xaudio2: Fix uninitialized variable access (Valgrind).\".", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "Revert \"xaudio2: Rewrite to use FAudio.\".", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "xaudio2_7: Fix build.", 1 },';
) >> "$patchlist"
fi
# Patchset xaudio2_7-CreateFX-FXEcho
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * xaudio2-revert
# |
# | This patchset fixes the following Wine bugs:
# | * [#39402] Support FXEcho interface in CreateFX
# |
# | Modified files:
# | * dlls/xaudio2_7/xapofx.c
# |
if test "$enable_xaudio2_7_CreateFX_FXEcho" -eq 1; then
patch_apply xaudio2_7-CreateFX-FXEcho/0001-xaudio2_7-Support-FXEcho-interface-in-CreateFX.patch
(
printf '%s\n' '+ { "Thomas Crider", "xaudio2_7: Support FXEcho interface in CreateFX.", 1 },';
) >> "$patchlist"
fi
# Patchset xaudio2_7-WMA_support
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * xaudio2-revert
# |
# | This patchset fixes the following Wine bugs:
# | * [#39402] Use ffmpeg 4.x to convert WMA format
# |
# | Modified files:
# | * configure.ac, dlls/x3daudio1_0/Makefile.in, dlls/x3daudio1_1/Makefile.in, dlls/x3daudio1_2/Makefile.in,
# | dlls/x3daudio1_3/Makefile.in, dlls/x3daudio1_4/Makefile.in, dlls/x3daudio1_5/Makefile.in, dlls/x3daudio1_6/Makefile.in,
# | dlls/x3daudio1_7/Makefile.in, dlls/xapofx1_1/Makefile.in, dlls/xapofx1_2/Makefile.in, dlls/xapofx1_3/Makefile.in,
# | dlls/xapofx1_4/Makefile.in, dlls/xapofx1_5/Makefile.in, dlls/xaudio2_0/Makefile.in, dlls/xaudio2_1/Makefile.in,
# | dlls/xaudio2_2/Makefile.in, dlls/xaudio2_3/Makefile.in, dlls/xaudio2_4/Makefile.in, dlls/xaudio2_5/Makefile.in,
# | dlls/xaudio2_6/Makefile.in, dlls/xaudio2_7/Makefile.in, dlls/xaudio2_7/xaudio_dll.c, dlls/xaudio2_7/xaudio_private.h,
# | dlls/xaudio2_8/Makefile.in, dlls/xaudio2_9/Makefile.in, include/config.h.in
# |
if test "$enable_xaudio2_7_WMA_support" -eq 1; then
patch_apply xaudio2_7-WMA_support/0001-xaudio2-Use-ffmpeg-to-convert-WMA-formats.patch
(
printf '%s\n' '+ { "Andrew Eikum", "xaudio2: Use ffmpeg to convert WMA formats.", 1 },';
) >> "$patchlist"
fi
# Patchset xaudio2_CommitChanges
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * xaudio2-revert
# |
# | This patchset fixes the following Wine bugs:
# | * [#44883] Return S_OK from IXAudio2Impl_CommitChanges()
# |
# | Modified files:
# | * dlls/xaudio2_7/xaudio_dll.c
# |
if test "$enable_xaudio2_CommitChanges" -eq 1; then
patch_apply xaudio2_CommitChanges/0001-xaudio2-Return-S_OK-in-IXAudio2-in-CommitChanges.patch
(
printf '%s\n' '+ { "Thomas Crider", "xaudio2: Return S_OK in IXAudio2 in CommitChanges.", 1 },';
) >> "$patchlist"
fi
if test "$enable_patchlist" -eq 1; then

View File

@ -1,48 +0,0 @@
From 6070be771682c1c1e621acfa9e25ab4ae0db0e75 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 3 Jul 2019 09:19:14 +1000
Subject: [PATCH 1/2] Revert "xaudio2: Export functions by ordinal."
This reverts commit 92a5299b1d0a0775e1158f334c0348a3ffe8f063.
---
dlls/xaudio2_8/xaudio2_8.spec | 12 ++++++------
dlls/xaudio2_9/xaudio2_9.spec | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/xaudio2_8/xaudio2_8.spec b/dlls/xaudio2_8/xaudio2_8.spec
index 78bf05bdb6..0b9f23866b 100644
--- a/dlls/xaudio2_8/xaudio2_8.spec
+++ b/dlls/xaudio2_8/xaudio2_8.spec
@@ -1,6 +1,6 @@
-1 stdcall -ordinal XAudio2Create(ptr long long)
-2 stdcall -ordinal CreateAudioReverb(ptr)
-3 stdcall -ordinal CreateAudioVolumeMeter(ptr)
-4 cdecl -ordinal CreateFX(ptr ptr ptr long)
-5 cdecl -ordinal X3DAudioCalculate(ptr ptr ptr long ptr)
-6 cdecl -ordinal X3DAudioInitialize(long float ptr)
+@ stdcall XAudio2Create(ptr long long)
+@ stdcall CreateAudioVolumeMeter(ptr)
+@ stdcall CreateAudioReverb(ptr)
+@ cdecl CreateFX(ptr ptr ptr long)
+@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr)
+@ cdecl X3DAudioInitialize(long float ptr)
diff --git a/dlls/xaudio2_9/xaudio2_9.spec b/dlls/xaudio2_9/xaudio2_9.spec
index 78bf05bdb6..0b9f23866b 100644
--- a/dlls/xaudio2_9/xaudio2_9.spec
+++ b/dlls/xaudio2_9/xaudio2_9.spec
@@ -1,6 +1,6 @@
-1 stdcall -ordinal XAudio2Create(ptr long long)
-2 stdcall -ordinal CreateAudioReverb(ptr)
-3 stdcall -ordinal CreateAudioVolumeMeter(ptr)
-4 cdecl -ordinal CreateFX(ptr ptr ptr long)
-5 cdecl -ordinal X3DAudioCalculate(ptr ptr ptr long ptr)
-6 cdecl -ordinal X3DAudioInitialize(long float ptr)
+@ stdcall XAudio2Create(ptr long long)
+@ stdcall CreateAudioVolumeMeter(ptr)
+@ stdcall CreateAudioReverb(ptr)
+@ cdecl CreateFX(ptr ptr ptr long)
+@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr)
+@ cdecl X3DAudioInitialize(long float ptr)
--
2.20.1

View File

@ -1,36 +0,0 @@
From 1e3508c74fcb56b75574f9a2d4d723d94976a3d4 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 3 Jul 2019 09:19:18 +1000
Subject: [PATCH 2/2] Revert "xaudio2: Add TRACE functions to
CreateAudioReverb/CreateAudioVolumeMeter."
This reverts commit 6103b8173b119fb8c80a107f0284a83399438066.
---
dlls/xaudio2_7/xaudio_dll.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c
index a87e0124d3..da0b0aa606 100644
--- a/dlls/xaudio2_7/xaudio_dll.c
+++ b/dlls/xaudio2_7/xaudio_dll.c
@@ -2075,8 +2075,6 @@ HRESULT WINAPI CreateAudioVolumeMeter(IUnknown **out)
IClassFactory *cf;
HRESULT hr;
- TRACE("%p\n", out);
-
hr = make_xapo_factory(&CLSID_AudioVolumeMeter27, &IID_IClassFactory, (void**)&cf);
if(FAILED(hr))
return hr;
@@ -2093,8 +2091,6 @@ HRESULT WINAPI CreateAudioReverb(IUnknown **out)
IClassFactory *cf;
HRESULT hr;
- TRACE("%p\n", out);
-
hr = make_xapo_factory(&CLSID_AudioReverb27, &IID_IClassFactory, (void**)&cf);
if(FAILED(hr))
return hr;
--
2.20.1

View File

@ -1,36 +0,0 @@
From 7eef5a822e898b55e8530f608ccc568b252b27fc Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 18 Jun 2019 08:16:48 +1000
Subject: [PATCH] Revert "xaudio2: Fix some TRACE calls erroneously marked as
stubs."
This reverts commit 07d3780d6888e795e9fe6da0391991f85b5f0947.
---
dlls/xaudio2_7/xaudio_dll.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c
index da0b0aa606..f135642524 100644
--- a/dlls/xaudio2_7/xaudio_dll.c
+++ b/dlls/xaudio2_7/xaudio_dll.c
@@ -1811,7 +1811,7 @@ static void WINAPI IXAudio2Impl_GetPerformanceData(IXAudio2 *iface,
{
IXAudio2Impl *This = impl_from_IXAudio2(iface);
- TRACE("(%p)->(%p)\n", This, pPerfData);
+ TRACE("(%p)->(%p): stub!\n", This, pPerfData);
FAudio_GetPerformanceData(This->faudio, (FAudioPerformanceData *)pPerfData);
}
@@ -1822,7 +1822,7 @@ static void WINAPI IXAudio2Impl_SetDebugConfiguration(IXAudio2 *iface,
{
IXAudio2Impl *This = impl_from_IXAudio2(iface);
- TRACE("(%p)->(%p, %p)\n", This, pDebugConfiguration, pReserved);
+ TRACE("(%p)->(%p, %p): stub!\n", This, pDebugConfiguration, pReserved);
FAudio_SetDebugConfiguration(This->faudio, (FAudioDebugConfiguration *)pDebugConfiguration, pReserved);
}
--
2.17.1

View File

@ -1,126 +0,0 @@
From 5572b69c353046c100291290c4864c87bd4eea12 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 24 May 2019 08:21:52 +1000
Subject: [PATCH] Revert "xaudio2: Use new features from FAudio 19.06 (but keep
compatibility for <=19.05)."
This reverts commit d341efeff071532801fdc224062eb9e60dc5aea0.
---
configure | 17 -----------------
configure.ac | 4 ----
dlls/xaudio2_7/x3daudio.c | 6 ------
dlls/xaudio2_7/xaudio_dll.c | 6 +-----
include/config.h.in | 6 ------
5 files changed, 1 insertion(+), 38 deletions(-)
diff --git a/configure b/configure
index 2ad2639..c206e8d 100755
--- a/configure
+++ b/configure
@@ -14966,23 +14966,6 @@ 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
diff --git a/configure.ac b/configure.ac
index f548e3e..83a8181 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1690,10 +1690,6 @@ 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.])
diff --git a/dlls/xaudio2_7/x3daudio.c b/dlls/xaudio2_7/x3daudio.c
index 5bc7c84..ee3367e 100644
--- a/dlls/xaudio2_7/x3daudio.c
+++ b/dlls/xaudio2_7/x3daudio.c
@@ -17,8 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "config.h"
-
#include <stdarg.h>
#include "windef.h"
@@ -53,12 +51,8 @@ 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 */
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c
index f135642..70ba243 100644
--- a/dlls/xaudio2_7/xaudio_dll.c
+++ b/dlls/xaudio2_7/xaudio_dll.c
@@ -1797,13 +1797,9 @@ static HRESULT WINAPI IXAudio2Impl_CommitChanges(IXAudio2 *iface,
{
IXAudio2Impl *This = impl_from_IXAudio2(iface);
- TRACE("(%p)->(0x%x)\n", This, operationSet);
+ TRACE("(%p)->(0x%x): stub!\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,
diff --git a/include/config.h.in b/include/config.h.in
index ce5c157..774e9ee 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -146,15 +146,9 @@
/* 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
--
1.9.1

View File

@ -1,25 +0,0 @@
From f917f4fe0b07dc32dac01c6759de8e10217d4143 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 16 May 2019 08:45:11 +1000
Subject: [PATCH] Revert "xaudio2: Fix 32-bit build."
This reverts commit 2de9d9ec440cb29460ca8ceeaa11c867c5d29359.
---
dlls/xaudio2_7/xaudio_dll.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c
index 70ba243..cbbedc4 100644
--- a/dlls/xaudio2_7/xaudio_dll.c
+++ b/dlls/xaudio2_7/xaudio_dll.c
@@ -35,7 +35,6 @@
#include "ole2.h"
#include "rpcproxy.h"
-#include "wine/asm.h"
#include "wine/debug.h"
#include "wine/heap.h"
--
1.9.1

View File

@ -1,151 +0,0 @@
From b2c367b179c7e0eb1f2890428f7b02eeb323443f Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 19 Mar 2019 08:41:08 +1100
Subject: [PATCH 1/6] Revert "xaudio2_7/tests: Remove redundant not-NULL checks
(coccinellery)."
This reverts commit 61d825ca3ed57ddec4a07f2e62f87432386a8daf.
---
dlls/xaudio2_7/tests/xaudio2.c | 104 +++++++++++++++++++++--------------------
1 file changed, 54 insertions(+), 50 deletions(-)
diff --git a/dlls/xaudio2_7/tests/xaudio2.c b/dlls/xaudio2_7/tests/xaudio2.c
index f2bffdf..4ead8d8 100644
--- a/dlls/xaudio2_7/tests/xaudio2.c
+++ b/dlls/xaudio2_7/tests/xaudio2.c
@@ -1000,9 +1000,28 @@ static void test_xapo_creation_legacy(const char *module, unsigned int version)
return;
}
- for(i = 0; i < ARRAY_SIZE(const_clsids); ++i){
- hr = pCreateFX(const_clsids[i], &fx_unk);
- ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i]), hr);
+ if(pCreateFX){
+ for(i = 0; i < ARRAY_SIZE(const_clsids); ++i){
+ hr = pCreateFX(const_clsids[i], &fx_unk);
+ ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i]), hr);
+ if(SUCCEEDED(hr)){
+ IXAPO *xapo;
+ hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo);
+ ok(hr == S_OK, "Couldn't get IXAPO27 interface: %08x\n", hr);
+ if(SUCCEEDED(hr))
+ IXAPO_Release(xapo);
+ IUnknown_Release(fx_unk);
+ }
+
+ hr = CoCreateInstance(const_clsids[i], NULL, CLSCTX_INPROC_SERVER,
+ &IID_IUnknown, (void**)&fx_unk);
+ ok(hr == REGDB_E_CLASSNOTREG, "CoCreateInstance should have failed: %08x\n", hr);
+ if(SUCCEEDED(hr))
+ IUnknown_Release(fx_unk);
+ }
+
+ hr = pCreateFX(avm_clsids[version - 20], &fx_unk);
+ ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(avm_clsids[version - 20]), hr);
if(SUCCEEDED(hr)){
IXAPO *xapo;
hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo);
@@ -1012,33 +1031,16 @@ static void test_xapo_creation_legacy(const char *module, unsigned int version)
IUnknown_Release(fx_unk);
}
- hr = CoCreateInstance(const_clsids[i], NULL, CLSCTX_INPROC_SERVER,
- &IID_IUnknown, (void**)&fx_unk);
- ok(hr == REGDB_E_CLASSNOTREG, "CoCreateInstance should have failed: %08x\n", hr);
- if(SUCCEEDED(hr))
+ hr = pCreateFX(ar_clsids[version - 20], &fx_unk);
+ ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(ar_clsids[version - 20]), hr);
+ if(SUCCEEDED(hr)){
+ IXAPO *xapo;
+ hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo);
+ ok(hr == S_OK, "Couldn't get IXAPO27 interface: %08x\n", hr);
+ if(SUCCEEDED(hr))
+ IXAPO_Release(xapo);
IUnknown_Release(fx_unk);
- }
-
- hr = pCreateFX(avm_clsids[version - 20], &fx_unk);
- ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(avm_clsids[version - 20]), hr);
- if(SUCCEEDED(hr)){
- IXAPO *xapo;
- hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo);
- ok(hr == S_OK, "Couldn't get IXAPO27 interface: %08x\n", hr);
- if(SUCCEEDED(hr))
- IXAPO_Release(xapo);
- IUnknown_Release(fx_unk);
- }
-
- hr = pCreateFX(ar_clsids[version - 20], &fx_unk);
- ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(ar_clsids[version - 20]), hr);
- if(SUCCEEDED(hr)){
- IXAPO *xapo;
- hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo);
- ok(hr == S_OK, "Couldn't get IXAPO27 interface: %08x\n", hr);
- if(SUCCEEDED(hr))
- IXAPO_Release(xapo);
- IUnknown_Release(fx_unk);
+ }
}
FreeLibrary(xapofxdll);
@@ -1081,9 +1083,29 @@ static void test_xapo_creation_modern(const char *module)
return;
}
- for(i = 0; i < ARRAY_SIZE(const_clsids); ++i){
- hr = pCreateFX(const_clsids[i], &fx_unk, NULL, 0);
- ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i]), hr);
+ if(pCreateFX){
+ for(i = 0; i < ARRAY_SIZE(const_clsids); ++i){
+ hr = pCreateFX(const_clsids[i], &fx_unk, NULL, 0);
+ ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i]), hr);
+ if(SUCCEEDED(hr)){
+ IXAPO *xapo;
+ hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO, (void**)&xapo);
+ ok(hr == S_OK, "Couldn't get IXAPO interface: %08x\n", hr);
+ if(SUCCEEDED(hr))
+ IXAPO_Release(xapo);
+ IUnknown_Release(fx_unk);
+ }
+
+ hr = CoCreateInstance(const_clsids[i], NULL, CLSCTX_INPROC_SERVER,
+ &IID_IUnknown, (void**)&fx_unk);
+ ok(hr == REGDB_E_CLASSNOTREG, "CoCreateInstance should have failed: %08x\n", hr);
+ if(SUCCEEDED(hr))
+ IUnknown_Release(fx_unk);
+ }
+
+ /* test legacy CLSID */
+ hr = pCreateFX(&CLSID_AudioVolumeMeter27, &fx_unk, NULL, 0);
+ ok(hr == S_OK, "%s: CreateFX(CLSID_AudioVolumeMeter) failed: %08x\n", module, hr);
if(SUCCEEDED(hr)){
IXAPO *xapo;
hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO, (void**)&xapo);
@@ -1092,24 +1114,6 @@ static void test_xapo_creation_modern(const char *module)
IXAPO_Release(xapo);
IUnknown_Release(fx_unk);
}
-
- hr = CoCreateInstance(const_clsids[i], NULL, CLSCTX_INPROC_SERVER,
- &IID_IUnknown, (void**)&fx_unk);
- ok(hr == REGDB_E_CLASSNOTREG, "CoCreateInstance should have failed: %08x\n", hr);
- if(SUCCEEDED(hr))
- IUnknown_Release(fx_unk);
- }
-
- /* test legacy CLSID */
- hr = pCreateFX(&CLSID_AudioVolumeMeter27, &fx_unk, NULL, 0);
- ok(hr == S_OK, "%s: CreateFX(CLSID_AudioVolumeMeter) failed: %08x\n", module, hr);
- if(SUCCEEDED(hr)){
- IXAPO *xapo;
- hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO, (void**)&xapo);
- ok(hr == S_OK, "Couldn't get IXAPO interface: %08x\n", hr);
- if(SUCCEEDED(hr))
- IXAPO_Release(xapo);
- IUnknown_Release(fx_unk);
}
pCAVM = (void*)GetProcAddress(xaudio2dll, "CreateAudioVolumeMeter");
--
1.9.1

View File

@ -1,27 +0,0 @@
From 8ec79581dd76617305c663a7b51add3e42b8ddda Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 19 Mar 2019 08:41:09 +1100
Subject: [PATCH 2/6] Revert "xaudio2_7: Add a trailing '\n' to an ERR()
message."
This reverts commit e664c29351b63888a4e6f7192dad999bf85270fe.
---
dlls/xaudio2_7/xapo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/xaudio2_7/xapo.c b/dlls/xaudio2_7/xapo.c
index 9788cb3..3ccb3f1 100644
--- a/dlls/xaudio2_7/xapo.c
+++ b/dlls/xaudio2_7/xapo.c
@@ -337,7 +337,7 @@ static inline HRESULT get_fapo_from_clsid(REFCLSID clsid, FAPO **fapo)
XAudio_Internal_Realloc
);
#endif
- ERR("Invalid XAPO CLSID!\n");
+ ERR("Invalid XAPO CLSID!");
return E_INVALIDARG;
}
--
1.9.1

View File

@ -1,41 +0,0 @@
From 5071ed20eaaa25c912fb5a2b416b9761907937fd Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 19 Mar 2019 08:41:09 +1100
Subject: [PATCH 3/6] Revert "xaudio2: IXAPO::Process out parameter should not
be const."
This reverts commit 53cd694e6a6b577635a3f524c7fc2bd0c1feaff3.
---
dlls/xaudio2_7/xapo.c | 2 +-
include/xapo.idl | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/xaudio2_7/xapo.c b/dlls/xaudio2_7/xapo.c
index 3ccb3f1..ccad417 100644
--- a/dlls/xaudio2_7/xapo.c
+++ b/dlls/xaudio2_7/xapo.c
@@ -175,7 +175,7 @@ static void WINAPI XAPOFX_UnlockForProcess(IXAPO *iface)
static void WINAPI XAPOFX_Process(IXAPO *iface, UINT32 in_params_count,
const XAPO_PROCESS_BUFFER_PARAMETERS *in_params,
UINT32 out_params_count,
- XAPO_PROCESS_BUFFER_PARAMETERS *out_params, BOOL enabled)
+ const XAPO_PROCESS_BUFFER_PARAMETERS *out_params, BOOL enabled)
{
XA2XAPOFXImpl *This = impl_from_IXAPO(iface);
TRACE("%p, %u, %p, %u, %p, %u\n", This, in_params_count, in_params,
diff --git a/include/xapo.idl b/include/xapo.idl
index 7b28ac9..9c3ad15 100644
--- a/include/xapo.idl
+++ b/include/xapo.idl
@@ -118,7 +118,7 @@ interface IXAPO : IUnknown
void UnlockForProcess(void);
void Process(UINT32 in_params_count, const XAPO_PROCESS_BUFFER_PARAMETERS *in_params,
- UINT32 out_params_count, XAPO_PROCESS_BUFFER_PARAMETERS *out_params,
+ UINT32 out_params_count, const XAPO_PROCESS_BUFFER_PARAMETERS *out_params,
BOOL enabled);
UINT32 CalcInputFrames(UINT32 output_frames);
--
1.9.1

View File

@ -1,374 +0,0 @@
From e4e9861d161de0563d77b5e23457063e10bde2ea Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 19 Mar 2019 08:41:10 +1100
Subject: [PATCH 4/6] Revert "xaudio2: IXAudio23 needs its own interface, for
XAUDIO23_VOICE_SENDS parameters."
This reverts commit b49b78db49d79bdd1358f2244a87d74db6350b73.
---
dlls/xaudio2_7/compat.c | 222 +---------------------------------------
dlls/xaudio2_7/xaudio_dll.c | 4 -
dlls/xaudio2_7/xaudio_private.h | 4 -
include/xaudio2.idl | 61 -----------
4 files changed, 5 insertions(+), 286 deletions(-)
diff --git a/dlls/xaudio2_7/compat.c b/dlls/xaudio2_7/compat.c
index c4538ae..bc33cb9 100644
--- a/dlls/xaudio2_7/compat.c
+++ b/dlls/xaudio2_7/compat.c
@@ -2488,222 +2488,6 @@ const IXAudio22Vtbl XAudio22_Vtbl = {
XA22_SetDebugConfiguration
};
-#elif XAUDIO2_VER <= 3
-
-static inline IXAudio2Impl *impl_from_IXAudio23(IXAudio23 *iface)
-{
- return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio23_iface);
-}
-
-static HRESULT WINAPI XA23_QueryInterface(IXAudio23 *iface, REFIID riid,
- void **ppvObject)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- return IXAudio2_QueryInterface(&This->IXAudio2_iface, riid, ppvObject);
-}
-
-static ULONG WINAPI XA23_AddRef(IXAudio23 *iface)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- return IXAudio2_AddRef(&This->IXAudio2_iface);
-}
-
-static ULONG WINAPI XA23_Release(IXAudio23 *iface)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- return IXAudio2_Release(&This->IXAudio2_iface);
-}
-
-static HRESULT WINAPI XA23_GetDeviceCount(IXAudio23 *iface, UINT32 *pCount)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- TRACE("%p, %p\n", This, pCount);
- return FAudio_GetDeviceCount(This->faudio, pCount);
-}
-
-static HRESULT WINAPI XA23_GetDeviceDetails(IXAudio23 *iface, UINT32 index,
- XAUDIO2_DEVICE_DETAILS *pDeviceDetails)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- TRACE("%p, %u, %p\n", This, index, pDeviceDetails);
- return FAudio_GetDeviceDetails(This->faudio, index, (FAudioDeviceDetails *)pDeviceDetails);
-}
-
-static HRESULT WINAPI XA23_Initialize(IXAudio23 *iface, UINT32 flags,
- XAUDIO2_PROCESSOR processor)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- TRACE("(%p)->(0x%x, 0x%x)\n", This, flags, processor);
- return xaudio2_initialize(This, flags, processor);
-}
-
-static HRESULT WINAPI XA23_RegisterForCallbacks(IXAudio23 *iface,
- IXAudio2EngineCallback *pCallback)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- return IXAudio2_RegisterForCallbacks(&This->IXAudio2_iface, pCallback);
-}
-
-static void WINAPI XA23_UnregisterForCallbacks(IXAudio23 *iface,
- IXAudio2EngineCallback *pCallback)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- IXAudio2_UnregisterForCallbacks(&This->IXAudio2_iface, pCallback);
-}
-
-static HRESULT WINAPI XA23_CreateSourceVoice(IXAudio23 *iface,
- IXAudio2SourceVoice **ppSourceVoice, const WAVEFORMATEX *pSourceFormat,
- UINT32 flags, float maxFrequencyRatio,
- IXAudio2VoiceCallback *pCallback, const XAUDIO23_VOICE_SENDS *pSendList,
- const XAUDIO2_EFFECT_CHAIN *pEffectChain)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- XAUDIO2_VOICE_SENDS sends, *psends = NULL;
- HRESULT hr;
-
- if(pSendList){
- sends.SendCount = pSendList->OutputCount;
- sends.pSends = convert_send_descriptors23(pSendList);
- psends = &sends;
- }
-
- hr = IXAudio2_CreateSourceVoice(&This->IXAudio2_iface, ppSourceVoice,
- pSourceFormat, flags, maxFrequencyRatio, pCallback, psends,
- pEffectChain);
-
- if(pSendList)
- HeapFree(GetProcessHeap(), 0, sends.pSends);
-
- return hr;
-}
-
-static HRESULT WINAPI XA23_CreateSubmixVoice(IXAudio23 *iface,
- IXAudio2SubmixVoice **ppSubmixVoice, UINT32 inputChannels,
- UINT32 inputSampleRate, UINT32 flags, UINT32 processingStage,
- const XAUDIO23_VOICE_SENDS *pSendList,
- const XAUDIO2_EFFECT_CHAIN *pEffectChain)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- XAUDIO2_VOICE_SENDS sends, *psends = NULL;
- HRESULT hr;
-
- if(pSendList){
- sends.SendCount = pSendList->OutputCount;
- sends.pSends = convert_send_descriptors23(pSendList);
- psends = &sends;
- }
-
- hr = IXAudio2_CreateSubmixVoice(&This->IXAudio2_iface, ppSubmixVoice,
- inputChannels, inputSampleRate, flags, processingStage, psends,
- pEffectChain);
-
- if(pSendList)
- HeapFree(GetProcessHeap(), 0, sends.pSends);
-
- return hr;
-}
-
-static HRESULT WINAPI XA23_CreateMasteringVoice(IXAudio23 *iface,
- IXAudio2MasteringVoice **ppMasteringVoice, UINT32 inputChannels,
- UINT32 inputSampleRate, UINT32 flags, UINT32 deviceIndex,
- const XAUDIO2_EFFECT_CHAIN *pEffectChain)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
-
- TRACE("(%p)->(%p, %u, %u, 0x%x, %u, %p)\n", This, ppMasteringVoice,
- inputChannels, inputSampleRate, flags, deviceIndex,
- pEffectChain);
-
- EnterCriticalSection(&This->lock);
-
- /* XAUDIO2_VER == 3 */
- *ppMasteringVoice = (IXAudio2MasteringVoice*)&This->mst.IXAudio23MasteringVoice_iface;
-
- EnterCriticalSection(&This->mst.lock);
-
- if(This->mst.in_use){
- LeaveCriticalSection(&This->mst.lock);
- LeaveCriticalSection(&This->lock);
- return COMPAT_E_INVALID_CALL;
- }
-
- LeaveCriticalSection(&This->lock);
-
- This->mst.effect_chain = wrap_effect_chain(pEffectChain);
-
- pthread_mutex_lock(&This->mst.engine_lock);
-
- This->mst.engine_thread = CreateThread(NULL, 0, &engine_thread, &This->mst, 0, NULL);
-
- pthread_cond_wait(&This->mst.engine_done, &This->mst.engine_lock);
-
- pthread_mutex_unlock(&This->mst.engine_lock);
-
- FAudio_SetEngineProcedureEXT(This->faudio, &engine_cb, &This->mst);
-
- FAudio_CreateMasteringVoice(This->faudio, &This->mst.faudio_voice, inputChannels,
- inputSampleRate, flags, deviceIndex, This->mst.effect_chain);
-
- This->mst.in_use = TRUE;
-
- LeaveCriticalSection(&This->mst.lock);
-
- return S_OK;
-}
-
-static HRESULT WINAPI XA23_StartEngine(IXAudio23 *iface)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- return IXAudio2_StartEngine(&This->IXAudio2_iface);
-}
-
-static void WINAPI XA23_StopEngine(IXAudio23 *iface)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- return IXAudio2_StopEngine(&This->IXAudio2_iface);
-}
-
-static HRESULT WINAPI XA23_CommitChanges(IXAudio23 *iface, UINT32 operationSet)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- return IXAudio2_CommitChanges(&This->IXAudio2_iface, operationSet);
-}
-
-static void WINAPI XA23_GetPerformanceData(IXAudio23 *iface,
- XAUDIO2_PERFORMANCE_DATA *pPerfData)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- return IXAudio2_GetPerformanceData(&This->IXAudio2_iface, pPerfData);
-}
-
-static void WINAPI XA23_SetDebugConfiguration(IXAudio23 *iface,
- const XAUDIO2_DEBUG_CONFIGURATION *pDebugConfiguration,
- void *pReserved)
-{
- IXAudio2Impl *This = impl_from_IXAudio23(iface);
- return IXAudio2_SetDebugConfiguration(&This->IXAudio2_iface,
- pDebugConfiguration, pReserved);
-}
-
-const IXAudio23Vtbl XAudio23_Vtbl = {
- XA23_QueryInterface,
- XA23_AddRef,
- XA23_Release,
- XA23_GetDeviceCount,
- XA23_GetDeviceDetails,
- XA23_Initialize,
- XA23_RegisterForCallbacks,
- XA23_UnregisterForCallbacks,
- XA23_CreateSourceVoice,
- XA23_CreateSubmixVoice,
- XA23_CreateMasteringVoice,
- XA23_StartEngine,
- XA23_StopEngine,
- XA23_CommitChanges,
- XA23_GetPerformanceData,
- XA23_SetDebugConfiguration
-};
-
#elif XAUDIO2_VER <= 7
static inline IXAudio2Impl *impl_from_IXAudio27(IXAudio27 *iface)
@@ -2804,8 +2588,12 @@ static HRESULT WINAPI XA27_CreateMasteringVoice(IXAudio27 *iface,
EnterCriticalSection(&This->lock);
- /* 4 <= XAUDIO2_VER <= 7 */
+ /* 3 <= XAUDIO2_VER <= 7 */
+#if XAUDIO2_VER == 3
+ *ppMasteringVoice = (IXAudio2MasteringVoice*)&This->mst.IXAudio23MasteringVoice_iface;
+#else
*ppMasteringVoice = (IXAudio2MasteringVoice*)&This->mst.IXAudio27MasteringVoice_iface;
+#endif
EnterCriticalSection(&This->mst.lock);
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c
index 18306a1..f338b56 100644
--- a/dlls/xaudio2_7/xaudio_dll.c
+++ b/dlls/xaudio2_7/xaudio_dll.c
@@ -1400,8 +1400,6 @@ static HRESULT WINAPI IXAudio2Impl_QueryInterface(IXAudio2 *iface, REFIID riid,
*ppvObject = &This->IXAudio20_iface;
#elif XAUDIO2_VER <= 2
*ppvObject = &This->IXAudio22_iface;
-#elif XAUDIO2_VER <= 3
- *ppvObject = &This->IXAudio23_iface;
#elif XAUDIO2_VER <= 7
*ppvObject = &This->IXAudio27_iface;
#else
@@ -1904,8 +1902,6 @@ static HRESULT WINAPI XAudio2CF_CreateInstance(IClassFactory *iface, IUnknown *p
object->IXAudio20_iface.lpVtbl = &XAudio20_Vtbl;
#elif XAUDIO2_VER <= 2
object->IXAudio22_iface.lpVtbl = &XAudio22_Vtbl;
-#elif XAUDIO2_VER <= 3
- object->IXAudio23_iface.lpVtbl = &XAudio23_Vtbl;
#elif XAUDIO2_VER <= 7
object->IXAudio27_iface.lpVtbl = &XAudio27_Vtbl;
#endif
diff --git a/dlls/xaudio2_7/xaudio_private.h b/dlls/xaudio2_7/xaudio_private.h
index 46d842b..84bab82 100644
--- a/dlls/xaudio2_7/xaudio_private.h
+++ b/dlls/xaudio2_7/xaudio_private.h
@@ -111,8 +111,6 @@ typedef struct _IXAudio2Impl {
IXAudio20 IXAudio20_iface;
#elif XAUDIO2_VER <= 2
IXAudio22 IXAudio22_iface;
-#elif XAUDIO2_VER <= 3
- IXAudio23 IXAudio23_iface;
#elif XAUDIO2_VER <= 7
IXAudio27 IXAudio27_iface;
#endif
@@ -160,8 +158,6 @@ extern XA2VoiceImpl *impl_from_IXAudio27MasteringVoice(IXAudio27MasteringVoice *
extern const IXAudio20Vtbl XAudio20_Vtbl DECLSPEC_HIDDEN;
#elif XAUDIO2_VER <= 2
extern const IXAudio22Vtbl XAudio22_Vtbl DECLSPEC_HIDDEN;
-#elif XAUDIO2_VER <= 3
-extern const IXAudio23Vtbl XAudio23_Vtbl DECLSPEC_HIDDEN;
#elif XAUDIO2_VER <= 7
extern const IXAudio27Vtbl XAudio27_Vtbl DECLSPEC_HIDDEN;
#endif
diff --git a/include/xaudio2.idl b/include/xaudio2.idl
index 074454d..e97cf99 100644
--- a/include/xaudio2.idl
+++ b/include/xaudio2.idl
@@ -1052,67 +1052,6 @@ interface IXAudio22 : IUnknown
[
object,
- uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb), /* all versions before 28 share IID_IXAudio */
-]
-/* XAudio2 2.3's IXAudio2 interface. Actually called IXAudio2 in the Nov 2008
- * DX SDK */
-interface IXAudio23 : IUnknown
-{
- HRESULT GetDeviceCount([out] UINT32* pCount);
-
- HRESULT GetDeviceDetails(
- [in] UINT32 Index,
- [out] XAUDIO2_DEVICE_DETAILS* pDeviceDetails);
-
- HRESULT Initialize(
- [in, defaultvalue(0)] UINT32 Flags,
- [in, defaultvalue(XAUDIO2_DEFAULT_PROCESSOR)] XAUDIO2_PROCESSOR XAudio2Processor);
-
- HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
-
- void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
-
- HRESULT CreateSourceVoice(
- [out] IXAudio2SourceVoice** ppSourceVoice,
- [in] const WAVEFORMATEX* pSourceFormat,
- [in, defaultvalue(0)] UINT32 Flags,
- [in, defaultvalue(XAUDIO2_DEFAULT_FREQ_RATIO)] float MaxFrequencyRatio,
- [in, defaultvalue(NULL)] IXAudio2VoiceCallback* pCallback,
- [in, defaultvalue(NULL)] const XAUDIO23_VOICE_SENDS* pSendList,
- [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
-
- HRESULT CreateSubmixVoice(
- [out] IXAudio2SubmixVoice** ppSubmixVoice,
- [in] UINT32 InputChannels,
- [in] UINT32 InputSampleRate,
- [in, defaultvalue(0)] UINT32 Flags,
- [in, defaultvalue(0)] UINT32 ProcessingStage,
- [in, defaultvalue(NULL)] const XAUDIO23_VOICE_SENDS* pSendList,
- [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
-
- HRESULT CreateMasteringVoice(
- [out] IXAudio2MasteringVoice** ppMasteringVoice,
- [in, defaultvalue(XAUDIO2_DEFAULT_CHANNELS)] UINT32 InputChannels,
- [in, defaultvalue(XAUDIO2_DEFAULT_SAMPLERATE)] UINT32 InputSampleRate,
- [in, defaultvalue(0)] UINT32 Flags,
- [in, defaultvalue(0)] UINT32 DeviceIndex,
- [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
-
- HRESULT StartEngine();
-
- void StopEngine();
-
- HRESULT CommitChanges([in] UINT32 OperationSet);
-
- void GetPerformanceData([out] XAUDIO2_PERFORMANCE_DATA* pPerfData);
-
- [local] void SetDebugConfiguration(
- [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
- [in, defaultvalue(NULL)] void* pReserved);
-}
-
-[
- object,
uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb),
]
/* XAudio2 2.7's IXAudio2 interface. Actually called IXAudio2 in the Jun 2010
--
1.9.1

View File

@ -1,54 +0,0 @@
From 4acda3a1fc934bebe9d6fa14a66688c23d664c24 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 19 Mar 2019 08:41:11 +1100
Subject: [PATCH 5/6] Revert "xaudio2: Fix uninitialized variable access
(Valgrind)."
This reverts commit ac8be6a1a24d49e1e32806b05dcf4591de5c691e.
---
dlls/xaudio2_7/compat.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/xaudio2_7/compat.c b/dlls/xaudio2_7/compat.c
index bc33cb9..318f668 100644
--- a/dlls/xaudio2_7/compat.c
+++ b/dlls/xaudio2_7/compat.c
@@ -923,7 +923,7 @@ static HRESULT WINAPI XA20SUB_SetOutputVoices(IXAudio20SubmixVoice *iface,
const XAUDIO23_VOICE_SENDS *pSendList)
{
XA2VoiceImpl *This = impl_from_IXAudio20SubmixVoice(iface);
- XAUDIO2_VOICE_SENDS sends, *psends = NULL;
+ XAUDIO2_VOICE_SENDS sends, *psends;
HRESULT hr;
TRACE("%p, %p\n", This, pSendList);
@@ -1483,7 +1483,7 @@ static HRESULT WINAPI XA20M_SetOutputVoices(IXAudio20MasteringVoice *iface,
const XAUDIO23_VOICE_SENDS *pSendList)
{
XA2VoiceImpl *This = impl_from_IXAudio20MasteringVoice(iface);
- XAUDIO2_VOICE_SENDS sends, *psends = NULL;
+ XAUDIO2_VOICE_SENDS sends, *psends;
HRESULT hr;
TRACE("%p, %p\n", This, pSendList);
@@ -2115,7 +2115,7 @@ static HRESULT WINAPI XA20_CreateSubmixVoice(IXAudio20 *iface,
const XAUDIO2_EFFECT_CHAIN *pEffectChain)
{
IXAudio2Impl *This = impl_from_IXAudio20(iface);
- XAUDIO2_VOICE_SENDS sends, *psends = NULL;
+ XAUDIO2_VOICE_SENDS sends, *psends;
HRESULT hr;
if(pSendList){
@@ -2350,7 +2350,7 @@ static HRESULT WINAPI XA22_CreateSubmixVoice(IXAudio22 *iface,
const XAUDIO2_EFFECT_CHAIN *pEffectChain)
{
IXAudio2Impl *This = impl_from_IXAudio22(iface);
- XAUDIO2_VOICE_SENDS sends, *psends = NULL;
+ XAUDIO2_VOICE_SENDS sends, *psends;
HRESULT hr;
if(pSendList){
--
1.9.1

View File

@ -1,24 +0,0 @@
From 76ff2b8644ec3e3b7c17ff3bc058dbdfc11a2ea0 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 17 May 2019 08:16:47 +1000
Subject: [PATCH] xaudio2_7: Fix build
---
dlls/xaudio2_7/xaudio_dll.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c
index 8fc2364..3dc0d6c 100644
--- a/dlls/xaudio2_7/xaudio_dll.c
+++ b/dlls/xaudio2_7/xaudio_dll.c
@@ -30,6 +30,7 @@
#include "xapofx.h"
+#include "wine/asm.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(xaudio2);
--
1.9.1

View File

@ -1 +0,0 @@
Fixes: Revert FAudio patches to avoid package issues with FAudio not being available for most distro's.

View File

@ -1,261 +0,0 @@
From ba0cddfbd617e00818836e0ac7af5984b0e51e84 Mon Sep 17 00:00:00 2001
From: Thomas Crider <gloriouseggroll@gmail.com>
Date: Mon, 27 Aug 2018 08:52:00 +1000
Subject: [PATCH] xaudio2_7: Support FXEcho interface in CreateFX.
---
dlls/xaudio2_7/xapofx.c | 223 +++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 221 insertions(+), 2 deletions(-)
diff --git a/dlls/xaudio2_7/xapofx.c b/dlls/xaudio2_7/xapofx.c
index e450851..017a3c5 100644
--- a/dlls/xaudio2_7/xapofx.c
+++ b/dlls/xaudio2_7/xapofx.c
@@ -650,6 +650,207 @@ static const IXAPOParametersVtbl EQXAPOParameters_Vtbl = {
EQXAPOParams_GetParameters
};
+typedef struct _echoimpl {
+ IXAPO IXAPO_iface;
+ IXAPOParameters IXAPOParameters_iface;
+
+ LONG ref;
+} echoimpl;
+
+static echoimpl *echoimpl_from_IXAPO(IXAPO *iface)
+{
+ return CONTAINING_RECORD(iface, echoimpl, IXAPO_iface);
+}
+
+static echoimpl *echoimpl_from_IXAPOParameters(IXAPOParameters *iface)
+{
+ return CONTAINING_RECORD(iface, echoimpl, IXAPOParameters_iface);
+}
+
+static HRESULT WINAPI echxapo_QueryInterface(IXAPO *iface, REFIID riid, void **ppvObject)
+{
+ echoimpl *This = echoimpl_from_IXAPO(iface);
+
+ TRACE("%p, %s, %p\n", This, wine_dbgstr_guid(riid), ppvObject);
+
+ if(IsEqualGUID(riid, &IID_IUnknown) ||
+ IsEqualGUID(riid, &IID_IXAPO) ||
+ IsEqualGUID(riid, &IID_IXAPO27))
+ *ppvObject = &This->IXAPO_iface;
+ else if(IsEqualGUID(riid, &IID_IXAPOParameters))
+ *ppvObject = &This->IXAPOParameters_iface;
+ else
+ *ppvObject = NULL;
+
+ if(*ppvObject){
+ IUnknown_AddRef((IUnknown*)*ppvObject);
+ return S_OK;
+ }
+
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI echxapo_AddRef(IXAPO *iface)
+{
+ echoimpl *This = echoimpl_from_IXAPO(iface);
+ ULONG ref = InterlockedIncrement(&This->ref);
+ TRACE("(%p)->(): Refcount now %u\n", This, ref);
+ return ref;
+}
+
+static ULONG WINAPI echxapo_Release(IXAPO *iface)
+{
+ echoimpl *This = echoimpl_from_IXAPO(iface);
+ ULONG ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p)->(): Refcount now %u\n", This, ref);
+
+ if(!ref)
+ HeapFree(GetProcessHeap(), 0, This);
+
+ return ref;
+}
+
+static HRESULT WINAPI echxapo_GetRegistrationProperties(IXAPO *iface,
+ XAPO_REGISTRATION_PROPERTIES **props)
+{
+ echoimpl *This = echoimpl_from_IXAPO(iface);
+ TRACE("%p, %p\n", This, props);
+ /* TODO: check for version == 20 and use XAPO20_REGISTRATION_PROPERTIES */
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI echxapo_IsInputFormatSupported(IXAPO *iface,
+ const WAVEFORMATEX *output_fmt, const WAVEFORMATEX *input_fmt,
+ WAVEFORMATEX **supported_fmt)
+{
+ echoimpl *This = echoimpl_from_IXAPO(iface);
+ TRACE("%p, %p, %p, %p\n", This, output_fmt, input_fmt, supported_fmt);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI echxapo_IsOutputFormatSupported(IXAPO *iface,
+ const WAVEFORMATEX *input_fmt, const WAVEFORMATEX *output_fmt,
+ WAVEFORMATEX **supported_fmt)
+{
+ echoimpl *This = echoimpl_from_IXAPO(iface);
+ TRACE("%p, %p, %p, %p\n", This, input_fmt, output_fmt, supported_fmt);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI echxapo_Initialize(IXAPO *iface, const void *data,
+ UINT32 data_len)
+{
+ echoimpl *This = echoimpl_from_IXAPO(iface);
+ TRACE("%p, %p, %u\n", This, data, data_len);
+ return E_NOTIMPL;
+}
+
+static void WINAPI echxapo_Reset(IXAPO *iface)
+{
+ echoimpl *This = echoimpl_from_IXAPO(iface);
+ TRACE("%p\n", This);
+}
+
+static HRESULT WINAPI echxapo_LockForProcess(IXAPO *iface, UINT32 in_params_count,
+ const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *in_params,
+ UINT32 out_params_count,
+ const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *out_params)
+{
+ echoimpl *This = echoimpl_from_IXAPO(iface);
+ TRACE("%p, %u, %p, %u, %p\n", This, in_params_count, in_params,
+ out_params_count, out_params);
+ return E_NOTIMPL;
+}
+
+static void WINAPI echxapo_UnlockForProcess(IXAPO *iface)
+{
+ echoimpl *This = echoimpl_from_IXAPO(iface);
+ TRACE("%p\n", This);
+}
+
+static void WINAPI echxapo_Process(IXAPO *iface, UINT32 in_params_count,
+ const XAPO_PROCESS_BUFFER_PARAMETERS *in_params,
+ UINT32 out_params_count,
+ const XAPO_PROCESS_BUFFER_PARAMETERS *out_params, BOOL enabled)
+{
+ echoimpl *This = echoimpl_from_IXAPO(iface);
+ TRACE("%p, %u, %p, %u, %p, %u\n", This, in_params_count, in_params,
+ out_params_count, out_params, enabled);
+}
+
+static UINT32 WINAPI echxapo_CalcInputFrames(IXAPO *iface, UINT32 output_frames)
+{
+ echoimpl *This = echoimpl_from_IXAPO(iface);
+ TRACE("%p, %u\n", This, output_frames);
+ return 0;
+}
+
+static UINT32 WINAPI echxapo_CalcOutputFrames(IXAPO *iface, UINT32 input_frames)
+{
+ echoimpl *This = echoimpl_from_IXAPO(iface);
+ TRACE("%p, %u\n", This, input_frames);
+ return 0;
+}
+
+
+static const IXAPOVtbl echxapo_Vtbl = {
+ echxapo_QueryInterface,
+ echxapo_AddRef,
+ echxapo_Release,
+ echxapo_GetRegistrationProperties,
+ echxapo_IsInputFormatSupported,
+ echxapo_IsOutputFormatSupported,
+ echxapo_Initialize,
+ echxapo_Reset,
+ echxapo_LockForProcess,
+ echxapo_UnlockForProcess,
+ echxapo_Process,
+ echxapo_CalcInputFrames,
+ echxapo_CalcOutputFrames
+};
+
+static HRESULT WINAPI echxapoparams_QueryInterface(IXAPOParameters *iface,
+ REFIID riid, void **ppvObject)
+{
+ echoimpl *This = echoimpl_from_IXAPOParameters(iface);
+ return RVBXAPO_QueryInterface(&This->IXAPO_iface, riid, ppvObject);
+}
+
+static ULONG WINAPI echxapoparams_AddRef(IXAPOParameters *iface)
+{
+ echoimpl *This = echoimpl_from_IXAPOParameters(iface);
+ return RVBXAPO_AddRef(&This->IXAPO_iface);
+}
+
+static ULONG WINAPI echxapoparams_Release(IXAPOParameters *iface)
+{
+ echoimpl *This = echoimpl_from_IXAPOParameters(iface);
+ return RVBXAPO_Release(&This->IXAPO_iface);
+}
+
+static void WINAPI echxapoparams_SetParameters(IXAPOParameters *iface,
+ const void *params, UINT32 params_len)
+{
+ echoimpl *This = echoimpl_from_IXAPOParameters(iface);
+ TRACE("%p, %p, %u\n", This, params, params_len);
+}
+
+static void WINAPI echxapoparams_GetParameters(IXAPOParameters *iface, void *params,
+ UINT32 params_len)
+{
+ echoimpl *This = echoimpl_from_IXAPOParameters(iface);
+ TRACE("%p, %p, %u\n", This, params, params_len);
+}
+
+static const IXAPOParametersVtbl ECHXAPOParameters_Vtbl = {
+ echxapoparams_QueryInterface,
+ echxapoparams_AddRef,
+ echxapoparams_Release,
+ echxapoparams_SetParameters,
+ echxapoparams_GetParameters
+};
+
struct xapo_cf {
IClassFactory IClassFactory_iface;
LONG ref;
@@ -752,8 +953,23 @@ static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOut
HeapFree(GetProcessHeap(), 0, object);
return hr;
}
+ }else if(IsEqualGUID(This->class, &CLSID_FXEcho)){
+ EQImpl *object;
+
+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
+ if(!object)
+ return E_OUTOFMEMORY;
+
+ object->IXAPO_iface.lpVtbl = &echxapo_Vtbl;
+ object->IXAPOParameters_iface.lpVtbl = &ECHXAPOParameters_Vtbl;
+
+ hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj);
+ if(FAILED(hr)){
+ HeapFree(GetProcessHeap(), 0, object);
+ return hr;
+ }
}else
- /* TODO FXECHO, FXMasteringLimiter, */
+ /* TODO FXMasteringLimiter, */
return E_INVALIDARG;
return S_OK;
@@ -895,7 +1111,10 @@ HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out)
else if(IsEqualGUID(clsid, &CLSID_FXEQ27) ||
IsEqualGUID(clsid, &CLSID_FXEQ))
class = &CLSID_FXEQ;
- /* TODO FXECHO, FXMasteringLimiter, */
+ else if(IsEqualGUID(clsid, &CLSID_FXEcho27) ||
+ IsEqualGUID(clsid, &CLSID_FXEcho))
+ class = &CLSID_FXEQ;
+ /* TODO FXMasteringLimiter, */
if(class){
hr = make_xapo_factory(class, &IID_IClassFactory, (void**)&cf);
--
1.9.1

View File

@ -1,2 +0,0 @@
Fixes: [39402] Support FXEcho interface in CreateFX
Depends: xaudio2-revert

View File

@ -1,888 +0,0 @@
From 9c762c7f5b077072cf5388c836bdbab519ff8241 Mon Sep 17 00:00:00 2001
From: Andrew Eikum <aeikum@codeweavers.com>
Date: Thu, 31 May 2018 10:58:48 -0500
Subject: [PATCH] xaudio2: Use ffmpeg to convert WMA formats
---
configure.ac | 33 +++
dlls/x3daudio1_0/Makefile.in | 2 +
dlls/x3daudio1_1/Makefile.in | 2 +
dlls/x3daudio1_2/Makefile.in | 2 +
dlls/x3daudio1_3/Makefile.in | 2 +
dlls/x3daudio1_4/Makefile.in | 2 +
dlls/x3daudio1_5/Makefile.in | 2 +
dlls/x3daudio1_6/Makefile.in | 2 +
dlls/x3daudio1_7/Makefile.in | 2 +
dlls/xapofx1_1/Makefile.in | 2 +
dlls/xapofx1_2/Makefile.in | 2 +
dlls/xapofx1_3/Makefile.in | 2 +
dlls/xapofx1_4/Makefile.in | 2 +
dlls/xapofx1_5/Makefile.in | 2 +
dlls/xaudio2_0/Makefile.in | 3 +-
dlls/xaudio2_1/Makefile.in | 3 +-
dlls/xaudio2_2/Makefile.in | 3 +-
dlls/xaudio2_3/Makefile.in | 3 +-
dlls/xaudio2_4/Makefile.in | 3 +-
dlls/xaudio2_5/Makefile.in | 3 +-
dlls/xaudio2_6/Makefile.in | 3 +-
dlls/xaudio2_7/Makefile.in | 3 +-
dlls/xaudio2_7/xaudio_dll.c | 370 +++++++++++++++++++++++++++++++-
dlls/xaudio2_7/xaudio_private.h | 9 +
dlls/xaudio2_8/Makefile.in | 3 +-
dlls/xaudio2_9/Makefile.in | 3 +-
include/config.h.in | 9 +
27 files changed, 457 insertions(+), 20 deletions(-)
diff --git a/configure.ac b/configure.ac
index ffb3ca523..0fc260487 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,6 +42,7 @@ AC_ARG_WITH(cups, AS_HELP_STRING([--without-cups],[do not use CUPS]))
AC_ARG_WITH(curses, AS_HELP_STRING([--without-curses],[do not use (n)curses]),
[if test "x$withval" = "xno"; then ac_cv_header_ncurses_h=no; ac_cv_header_curses_h=no; fi])
AC_ARG_WITH(dbus, AS_HELP_STRING([--without-dbus],[do not use DBus (dynamic device support)]))
+AC_ARG_WITH(ffmpeg, AS_HELP_STRING([--without-ffmpeg],[do not use the FFmpeg library]))
AC_ARG_WITH(float-abi, AS_HELP_STRING([--with-float-abi=abi],[specify the ABI (soft|softfp|hard) for ARM platforms]))
AC_ARG_WITH(fontconfig,AS_HELP_STRING([--without-fontconfig],[do not use fontconfig]))
AC_ARG_WITH(freetype, AS_HELP_STRING([--without-freetype],[do not use the FreeType library]))
@@ -1799,6 +1800,38 @@ WINE_NOTICE_WITH(mpg123,[test "x$ac_cv_lib_mpg123_mpg123_feed" != xyes -a x"$ac_
[enable_l3codeca_acm])
test "x$ac_cv_lib_mpg123_mpg123_feed" = xyes || enable_mp3dmod=${enable_mp3dmod:-no}
+dnl **** Check for FFmpeg's libavutil ****
+if test "x$with_ffmpeg" != "xno"
+then
+ WINE_PACKAGE_FLAGS(LIBAVUTIL,[libavutil],[-llibavutil],,,
+ [AC_CHECK_HEADERS([libavutil/avutil.h])
+ if test "$ac_cv_header_libavutil_avutil_h" = "yes"
+ then
+ AC_CHECK_LIB(avutil,av_frame_alloc,[:],[LIBAVUTIL_LIBS=""],[$LIBAVUTIL_LIBS])
+ else
+ LIBAVUTIL_CFLAGS=""
+ LIBAVUTIL_LIBS=""
+ fi])
+fi
+
+dnl **** Check for FFmpeg's libavcodec ****
+if test "x$with_ffmpeg" != "xno" -a "x$ac_cv_lib_avutil_av_frame_alloc" = "xyes"
+then
+ WINE_PACKAGE_FLAGS(LIBAVCODEC,[libavcodec],[-llibavcodec],,,
+ [AC_CHECK_HEADERS([libavcodec/avcodec.h])
+ if test "$ac_cv_header_libavcodec_avcodec_h" = "yes"
+ then
+ AC_CHECK_LIB(avcodec,avcodec_send_packet,
+ [AC_DEFINE(HAVE_FFMPEG, 1, [Define to 1 if you have libavutil and libavcodec from ffmpeg.])],
+ [LIBAVCODEC_LIBS=""], [$LIBAVUTIL_LIBS $LIBAVCODEC_LIBS])
+ else
+ LIBAVCODEC_CFLAGS=""
+ LIBAVCODEC_LIBS=""
+ fi])
+fi
+WINE_NOTICE_WITH(ffmpeg,[test "x$ac_cv_lib_avcodec_avcodec_send_packet" != xyes],
+ [libavcodec ${notice_platform}development files not found (or too old), XAudio2 WMA conversion won't be supported.])
+
dnl **** Check for OpenAL 1.1 ****
if test "$ac_cv_header_AL_al_h" = "yes"
then
diff --git a/dlls/x3daudio1_0/Makefile.in b/dlls/x3daudio1_0/Makefile.in
index 9b4ce2189..6c2b0058b 100644
--- a/dlls/x3daudio1_0/Makefile.in
+++ b/dlls/x3daudio1_0/Makefile.in
@@ -1,5 +1,7 @@
EXTRADEFS = -DX3DAUDIO1_VER=0 -DXAUDIO2_VER=0
MODULE = x3daudio1_0.dll
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/x3daudio1_1/Makefile.in b/dlls/x3daudio1_1/Makefile.in
index d866dc3dd..e268e3c5e 100644
--- a/dlls/x3daudio1_1/Makefile.in
+++ b/dlls/x3daudio1_1/Makefile.in
@@ -1,5 +1,7 @@
EXTRADEFS = -DX3DAUDIO1_VER=1 -DXAUDIO2_VER=1
MODULE = x3daudio1_1.dll
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/x3daudio1_2/Makefile.in b/dlls/x3daudio1_2/Makefile.in
index d5de11b25..758412305 100644
--- a/dlls/x3daudio1_2/Makefile.in
+++ b/dlls/x3daudio1_2/Makefile.in
@@ -1,5 +1,7 @@
EXTRADEFS = -DX3DAUDIO1_VER=2 -DXAUDIO2_VER=2
MODULE = x3daudio1_2.dll
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/x3daudio1_3/Makefile.in b/dlls/x3daudio1_3/Makefile.in
index cfd2c6c6c..084336d46 100644
--- a/dlls/x3daudio1_3/Makefile.in
+++ b/dlls/x3daudio1_3/Makefile.in
@@ -1,5 +1,7 @@
EXTRADEFS = -DX3DAUDIO1_VER=3 -DXAUDIO2_VER=3
MODULE = x3daudio1_3.dll
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/x3daudio1_4/Makefile.in b/dlls/x3daudio1_4/Makefile.in
index bd0eac7fc..691a71ad2 100644
--- a/dlls/x3daudio1_4/Makefile.in
+++ b/dlls/x3daudio1_4/Makefile.in
@@ -1,5 +1,7 @@
EXTRADEFS = -DX3DAUDIO1_VER=4 -DXAUDIO2_VER=4
MODULE = x3daudio1_4.dll
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/x3daudio1_5/Makefile.in b/dlls/x3daudio1_5/Makefile.in
index dac67aef7..cee7b4b28 100644
--- a/dlls/x3daudio1_5/Makefile.in
+++ b/dlls/x3daudio1_5/Makefile.in
@@ -1,5 +1,7 @@
EXTRADEFS = -DX3DAUDIO1_VER=5 -DXAUDIO2_VER=5
MODULE = x3daudio1_5.dll
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/x3daudio1_6/Makefile.in b/dlls/x3daudio1_6/Makefile.in
index 177fb8d34..23876bd8a 100644
--- a/dlls/x3daudio1_6/Makefile.in
+++ b/dlls/x3daudio1_6/Makefile.in
@@ -1,5 +1,7 @@
EXTRADEFS = -DX3DAUDIO1_VER=6 -DXAUDIO2_VER=6
MODULE = x3daudio1_6.dll
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/x3daudio1_7/Makefile.in b/dlls/x3daudio1_7/Makefile.in
index 019588dce..448a54867 100644
--- a/dlls/x3daudio1_7/Makefile.in
+++ b/dlls/x3daudio1_7/Makefile.in
@@ -1,5 +1,7 @@
EXTRADEFS = -DX3DAUDIO1_VER=7 -DXAUDIO2_VER=7
MODULE = x3daudio1_7.dll
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xapofx1_1/Makefile.in b/dlls/xapofx1_1/Makefile.in
index f69ff86bd..e43cfcf0a 100644
--- a/dlls/xapofx1_1/Makefile.in
+++ b/dlls/xapofx1_1/Makefile.in
@@ -1,6 +1,8 @@
EXTRADEFS = -DXAPOFX1_VER=1 -DXAUDIO2_VER=2
MODULE = xapofx1_1.dll
IMPORTS = ole32
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xapofx1_2/Makefile.in b/dlls/xapofx1_2/Makefile.in
index d56a2be4b..bf4df8b09 100644
--- a/dlls/xapofx1_2/Makefile.in
+++ b/dlls/xapofx1_2/Makefile.in
@@ -1,6 +1,8 @@
EXTRADEFS = -DXAPOFX1_VER=2 -DXAUDIO2_VER=3
MODULE = xapofx1_2.dll
IMPORTS = ole32
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xapofx1_3/Makefile.in b/dlls/xapofx1_3/Makefile.in
index 1139520b7..4a3056d8d 100644
--- a/dlls/xapofx1_3/Makefile.in
+++ b/dlls/xapofx1_3/Makefile.in
@@ -1,6 +1,8 @@
EXTRADEFS = -DXAPOFX1_VER=3 -DXAUDIO2_VER=4
MODULE = xapofx1_3.dll
IMPORTS = ole32
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xapofx1_4/Makefile.in b/dlls/xapofx1_4/Makefile.in
index b49e4643a..36672e776 100644
--- a/dlls/xapofx1_4/Makefile.in
+++ b/dlls/xapofx1_4/Makefile.in
@@ -1,6 +1,8 @@
EXTRADEFS = -DXAPOFX1_VER=4 -DXAUDIO2_VER=6
MODULE = xapofx1_4.dll
IMPORTS = ole32
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xapofx1_5/Makefile.in b/dlls/xapofx1_5/Makefile.in
index 5055a16fd..f9244f593 100644
--- a/dlls/xapofx1_5/Makefile.in
+++ b/dlls/xapofx1_5/Makefile.in
@@ -1,6 +1,8 @@
EXTRADEFS = -DXAPOFX1_VER=5 -DXAUDIO2_VER=7
MODULE = xapofx1_5.dll
IMPORTS = ole32
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xaudio2_0/Makefile.in b/dlls/xaudio2_0/Makefile.in
index cf15c7bf0..d8d282bcd 100644
--- a/dlls/xaudio2_0/Makefile.in
+++ b/dlls/xaudio2_0/Makefile.in
@@ -1,7 +1,8 @@
EXTRADEFS = -DXAUDIO2_VER=0
MODULE = xaudio2_0.dll
IMPORTS = advapi32 ole32 user32 uuid
-EXTRALIBS = $(OPENAL_LIBS)
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xaudio2_1/Makefile.in b/dlls/xaudio2_1/Makefile.in
index 32a5a62a2..a0d7bfc7c 100644
--- a/dlls/xaudio2_1/Makefile.in
+++ b/dlls/xaudio2_1/Makefile.in
@@ -1,7 +1,8 @@
EXTRADEFS = -DXAUDIO2_VER=1
MODULE = xaudio2_1.dll
IMPORTS = advapi32 ole32 user32 uuid
-EXTRALIBS = $(OPENAL_LIBS)
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xaudio2_2/Makefile.in b/dlls/xaudio2_2/Makefile.in
index f20de2d5f..4ba7e6c34 100644
--- a/dlls/xaudio2_2/Makefile.in
+++ b/dlls/xaudio2_2/Makefile.in
@@ -1,7 +1,8 @@
EXTRADEFS = -DXAUDIO2_VER=2
MODULE = xaudio2_2.dll
IMPORTS = advapi32 ole32 user32 uuid
-EXTRALIBS = $(OPENAL_LIBS)
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xaudio2_3/Makefile.in b/dlls/xaudio2_3/Makefile.in
index ca749f247..62c644f6e 100644
--- a/dlls/xaudio2_3/Makefile.in
+++ b/dlls/xaudio2_3/Makefile.in
@@ -1,7 +1,8 @@
EXTRADEFS = -DXAUDIO2_VER=3
MODULE = xaudio2_3.dll
IMPORTS = advapi32 ole32 user32 uuid
-EXTRALIBS = $(OPENAL_LIBS)
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xaudio2_4/Makefile.in b/dlls/xaudio2_4/Makefile.in
index 0b74f68fd..b77753fb0 100644
--- a/dlls/xaudio2_4/Makefile.in
+++ b/dlls/xaudio2_4/Makefile.in
@@ -1,7 +1,8 @@
EXTRADEFS = -DXAUDIO2_VER=4
MODULE = xaudio2_4.dll
IMPORTS = advapi32 ole32 user32 uuid
-EXTRALIBS = $(OPENAL_LIBS)
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xaudio2_5/Makefile.in b/dlls/xaudio2_5/Makefile.in
index 09356c94a..bd6873489 100644
--- a/dlls/xaudio2_5/Makefile.in
+++ b/dlls/xaudio2_5/Makefile.in
@@ -1,7 +1,8 @@
EXTRADEFS = -DXAUDIO2_VER=5
MODULE = xaudio2_5.dll
IMPORTS = advapi32 ole32 user32 uuid
-EXTRALIBS = $(OPENAL_LIBS)
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xaudio2_6/Makefile.in b/dlls/xaudio2_6/Makefile.in
index e0ef58815..17295098f 100644
--- a/dlls/xaudio2_6/Makefile.in
+++ b/dlls/xaudio2_6/Makefile.in
@@ -1,7 +1,8 @@
EXTRADEFS = -DXAUDIO2_VER=6
MODULE = xaudio2_6.dll
IMPORTS = advapi32 ole32 user32 uuid
-EXTRALIBS = $(OPENAL_LIBS)
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xaudio2_7/Makefile.in b/dlls/xaudio2_7/Makefile.in
index 2f2e23200..41d307dca 100644
--- a/dlls/xaudio2_7/Makefile.in
+++ b/dlls/xaudio2_7/Makefile.in
@@ -1,7 +1,8 @@
EXTRADEFS = -DXAUDIO2_VER=7
MODULE = xaudio2_7.dll
IMPORTS = advapi32 ole32 user32 uuid
-EXTRALIBS = $(OPENAL_LIBS)
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
C_SRCS = \
compat.c \
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c
index 0bbe943f1..2e65f47ea 100644
--- a/dlls/xaudio2_7/xaudio_dll.c
+++ b/dlls/xaudio2_7/xaudio_dll.c
@@ -82,6 +82,11 @@ __ASM_GLOBAL_FUNC( call_on_voice_processing_pass_start,
"ret" )
#endif
+#define IS_WMA(tag) (tag == WAVE_FORMAT_MSAUDIO1 || \
+ tag == WAVE_FORMAT_WMAUDIO2 || \
+ tag == WAVE_FORMAT_WMAUDIO3 || \
+ tag == WAVE_FORMAT_WMAUDIO_LOSSLESS)
+
static void dump_fmt(const WAVEFORMATEX *fmt)
{
TRACE("wFormatTag: 0x%x (", fmt->wFormatTag);
@@ -90,6 +95,11 @@ static void dump_fmt(const WAVEFORMATEX *fmt)
DOCASE(WAVE_FORMAT_PCM)
DOCASE(WAVE_FORMAT_IEEE_FLOAT)
DOCASE(WAVE_FORMAT_EXTENSIBLE)
+ DOCASE(WAVE_FORMAT_ADPCM)
+ DOCASE(WAVE_FORMAT_MSAUDIO1)
+ DOCASE(WAVE_FORMAT_WMAUDIO2)
+ DOCASE(WAVE_FORMAT_WMAUDIO3)
+ DOCASE(WAVE_FORMAT_WMAUDIO_LOSSLESS)
#undef DOCASE
default:
TRACE("Unknown");
@@ -462,6 +472,10 @@ static void WINAPI XA2SRC_DestroyVoice(IXAudio2SourceVoice *iface)
}
HeapFree(GetProcessHeap(), 0, This->fmt);
+ HeapFree(GetProcessHeap(), 0, This->scratch_buf);
+ This->scratch_buf = NULL;
+ HeapFree(GetProcessHeap(), 0, This->convert_buf);
+ This->convert_buf = NULL;
alDeleteBuffers(XAUDIO2_MAX_QUEUED_BUFFERS, This->al_bufs);
alDeleteSources(1, &This->al_src);
@@ -474,6 +488,17 @@ static void WINAPI XA2SRC_DestroyVoice(IXAudio2SourceVoice *iface)
This->cur_buf = 0;
This->abandoned_albufs = 0;
+#if HAVE_FFMPEG
+ if(This->conv_ctx){
+ HeapFree(GetProcessHeap(), 0, This->conv_ctx->extradata);
+ av_frame_free(&This->conv_frame);
+ This->conv_frame = NULL;
+ avcodec_close(This->conv_ctx);
+ av_free(This->conv_ctx);
+ This->conv_ctx = NULL;
+ }
+#endif
+
LeaveCriticalSection(&This->lock);
}
@@ -579,6 +604,97 @@ static ALenum get_al_format(const WAVEFORMATEX *fmt)
return 0;
}
+#if HAVE_FFMPEG
+static enum AVCodecID get_ffmpeg_format(const WAVEFORMATEX *pSourceFormat)
+{
+ switch(pSourceFormat->wFormatTag){
+ case WAVE_FORMAT_MSAUDIO1:
+ return AV_CODEC_ID_WMAV1;
+ case WAVE_FORMAT_WMAUDIO2:
+ return AV_CODEC_ID_WMAV2;
+ case WAVE_FORMAT_WMAUDIO3:
+ return AV_CODEC_ID_WMAPRO;
+ case WAVE_FORMAT_WMAUDIO_LOSSLESS:
+ return AV_CODEC_ID_WMALOSSLESS;
+ case WAVE_FORMAT_ADPCM:
+ return AV_CODEC_ID_ADPCM_MS;
+ }
+ return 0;
+}
+
+static ALenum ffmpeg_to_al_fmt(enum AVSampleFormat fmt, int channels)
+{
+ switch(fmt){
+ case AV_SAMPLE_FMT_U8:
+ case AV_SAMPLE_FMT_U8P:
+ switch(channels){
+ case 1:
+ return AL_FORMAT_MONO8;
+ case 2:
+ return AL_FORMAT_STEREO8;
+ case 4:
+ return AL_FORMAT_QUAD8;
+ case 6:
+ return AL_FORMAT_51CHN8;
+ case 7:
+ return AL_FORMAT_61CHN8;
+ case 8:
+ return AL_FORMAT_71CHN8;
+ }
+ break;
+ case AV_SAMPLE_FMT_S16:
+ case AV_SAMPLE_FMT_S16P:
+ switch(channels){
+ case 1:
+ return AL_FORMAT_MONO16;
+ case 2:
+ return AL_FORMAT_STEREO16;
+ case 4:
+ return AL_FORMAT_QUAD16;
+ case 6:
+ return AL_FORMAT_51CHN16;
+ case 7:
+ return AL_FORMAT_61CHN16;
+ case 8:
+ return AL_FORMAT_71CHN16;
+ }
+ break;
+ case AV_SAMPLE_FMT_S32:
+ case AV_SAMPLE_FMT_S32P:
+ switch(channels){
+ /* TODO: mono/stereo? */
+ case 4:
+ return AL_FORMAT_QUAD32;
+ case 6:
+ return AL_FORMAT_51CHN32;
+ case 7:
+ return AL_FORMAT_61CHN32;
+ case 8:
+ return AL_FORMAT_71CHN32;
+ }
+ case AV_SAMPLE_FMT_FLT:
+ case AV_SAMPLE_FMT_FLTP:
+ switch(channels){
+ case 1:
+ return AL_FORMAT_MONO_FLOAT32;
+ case 2:
+ return AL_FORMAT_STEREO_FLOAT32;
+ }
+ case AV_SAMPLE_FMT_DBL:
+ case AV_SAMPLE_FMT_DBLP:
+ switch(channels){
+ case 1:
+ return AL_FORMAT_MONO_DOUBLE_EXT;
+ case 2:
+ return AL_FORMAT_STEREO_DOUBLE_EXT;
+ }
+ default:
+ break;
+ }
+ return 0;
+}
+#endif
+
static HRESULT WINAPI XA2SRC_SubmitSourceBuffer(IXAudio2SourceVoice *iface,
const XAUDIO2_BUFFER *pBuffer, const XAUDIO2_BUFFER_WMA *pBufferWMA)
{
@@ -622,7 +738,10 @@ static HRESULT WINAPI XA2SRC_SubmitSourceBuffer(IXAudio2SourceVoice *iface,
#endif
/* convert samples offsets to bytes */
- if(This->fmt->wFormatTag == WAVE_FORMAT_ADPCM){
+ if(IS_WMA(This->fmt->wFormatTag)){
+ /* Offsets for WMA appear to just be byte offsets, since it doesn't
+ * have the concept of "samples". */
+ }else if(This->fmt->wFormatTag == WAVE_FORMAT_ADPCM){
/* ADPCM gives us a number of samples per block, so round down to
* nearest block and convert to bytes */
buf->xa2buffer.PlayBegin = buf->xa2buffer.PlayBegin / ((ADPCMWAVEFORMAT*)This->fmt)->wSamplesPerBlock * This->fmt->nBlockAlign;
@@ -1515,19 +1634,119 @@ static HRESULT WINAPI IXAudio2Impl_CreateSourceVoice(IXAudio2 *iface,
src->al_fmt = get_al_format(pSourceFormat);
if(!src->al_fmt){
- src->in_use = FALSE;
- LeaveCriticalSection(&src->lock);
- WARN("OpenAL can't convert this format!\n");
- return AUDCLNT_E_UNSUPPORTED_FORMAT;
- }
+#if HAVE_FFMPEG
+ enum AVCodecID cid;
+ AVCodec *codec;
+
+ TRACE("OpenAL can't use this format, so using FFmpeg\n");
+
+ cid = get_ffmpeg_format(pSourceFormat);
+ if(!cid){
+ WARN("Don't know how to convert this format to an FFmpeg codec\n");
+ src->in_use = FALSE;
+ LeaveCriticalSection(&src->lock);
+ return AUDCLNT_E_UNSUPPORTED_FORMAT;
+ }
+
+ codec = avcodec_find_decoder(cid);
+ if(!codec){
+ WARN("FFmpeg can't convert this format (0x%x), so failing\n", cid);
+ src->in_use = FALSE;
+ LeaveCriticalSection(&src->lock);
+ return AUDCLNT_E_UNSUPPORTED_FORMAT;
+ }
+
+ src->conv_ctx = avcodec_alloc_context3(codec);
+ if(!src->conv_ctx){
+ WARN("avcodec_alloc_context3 failed\n");
+ src->in_use = FALSE;
+ LeaveCriticalSection(&src->lock);
+ return AUDCLNT_E_UNSUPPORTED_FORMAT;
+ }
+
+ src->conv_ctx->bit_rate = pSourceFormat->nAvgBytesPerSec * 8;
+ src->conv_ctx->channels = pSourceFormat->nChannels;
+ src->conv_ctx->sample_rate = pSourceFormat->nSamplesPerSec;
+ src->conv_ctx->block_align = pSourceFormat->nBlockAlign;
+ src->conv_ctx->bits_per_coded_sample = pSourceFormat->wBitsPerSample;
+ src->conv_ctx->extradata_size = pSourceFormat->cbSize;
+ if(pSourceFormat->cbSize){
+ src->conv_ctx->extradata = HeapAlloc(GetProcessHeap(), 0, pSourceFormat->cbSize + AV_INPUT_BUFFER_PADDING_SIZE);
+ memcpy(src->conv_ctx->extradata, (&pSourceFormat->cbSize) + 1, pSourceFormat->cbSize);
+ }else if(IS_WMA(pSourceFormat->wFormatTag)){
+ /* xWMA doesn't provide the extradata info that FFmpeg needs to
+ * decode WMA data, so we create some fake extradata. This is taken
+ * from <ffmpeg/libavformat/xwma.c>. */
+ TRACE("synthesizing extradata for xWMA\n");
+ src->conv_ctx->extradata_size = 6;
+ src->conv_ctx->extradata = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, AV_INPUT_BUFFER_PADDING_SIZE);
+ src->conv_ctx->extradata[4] = 31;
+ }
- src->submit_blocksize = pSourceFormat->nBlockAlign;
+ if(avcodec_open2(src->conv_ctx, codec, NULL) < 0){
+ WARN("avcodec_open2 failed\n");
+ HeapFree(GetProcessHeap(), 0, src->conv_ctx->extradata);
+ av_free(src->conv_ctx);
+ src->conv_ctx = NULL;
+ src->in_use = FALSE;
+ LeaveCriticalSection(&src->lock);
+ return AUDCLNT_E_UNSUPPORTED_FORMAT;
+ }
+
+ src->conv_frame = av_frame_alloc();
+ if(!src->conv_ctx){
+ WARN("av_frame_alloc failed\n");
+ avcodec_close(src->conv_ctx);
+ HeapFree(GetProcessHeap(), 0, src->conv_ctx->extradata);
+ av_free(src->conv_ctx);
+ src->conv_ctx = NULL;
+ src->in_use = FALSE;
+ LeaveCriticalSection(&src->lock);
+ return AUDCLNT_E_UNSUPPORTED_FORMAT;
+ }
+
+ src->al_fmt = ffmpeg_to_al_fmt(src->conv_ctx->sample_fmt, pSourceFormat->nChannels);
+ if(!src->al_fmt){
+ WARN("OpenAL can't use FFmpeg output format\n");
+ av_frame_free(&src->conv_frame);
+ src->conv_frame = NULL;
+ avcodec_close(src->conv_ctx);
+ HeapFree(GetProcessHeap(), 0, src->conv_ctx->extradata);
+ av_free(src->conv_ctx);
+ src->conv_ctx = NULL;
+ src->in_use = FALSE;
+ LeaveCriticalSection(&src->lock);
+ return AUDCLNT_E_UNSUPPORTED_FORMAT;
+ }
+
+ src->submit_blocksize = av_get_bytes_per_sample(src->conv_ctx->sample_fmt);
+
+ src->scratch_bytes = This->period_frames * 1.5 * src->submit_blocksize;
+ src->scratch_buf = HeapAlloc(GetProcessHeap(), 0, src->scratch_bytes);
+
+ src->convert_bytes = pSourceFormat->nBlockAlign + AV_INPUT_BUFFER_PADDING_SIZE;
+ src->convert_buf = HeapAlloc(GetProcessHeap(), 0, src->convert_bytes);
+#else
+ WARN("OpenAL can't use this format and no FFmpeg, so giving up\n");
+#endif
+ }else
+ src->submit_blocksize = pSourceFormat->nBlockAlign;
src->fmt = copy_waveformat(pSourceFormat);
hr = XA2SRC_SetOutputVoices(&src->IXAudio2SourceVoice_iface, pSendList);
if(FAILED(hr)){
HeapFree(GetProcessHeap(), 0, src->fmt);
+#if HAVE_FFMPEG
+ if(src->conv_ctx){
+ av_frame_free(&src->conv_frame);
+ src->conv_frame = NULL;
+ avcodec_close(src->conv_ctx);
+ HeapFree(GetProcessHeap(), 0, src->conv_ctx->extradata);
+ av_free(src->conv_ctx);
+ src->conv_ctx = NULL;
+ }
+#endif
src->in_use = FALSE;
LeaveCriticalSection(&src->lock);
return hr;
@@ -2257,6 +2476,9 @@ HRESULT WINAPI XAudio2Create(IXAudio2 **ppxa2, UINT32 flags, XAUDIO2_PROCESSOR p
* buffer's data has all been queued */
static BOOL xa2buffer_queue_period(XA2SourceImpl *src, XA2Buffer *buf, ALuint al_buf)
{
+#if HAVE_FFMPEG
+ int averr;
+#endif
UINT32 submit_bytes;
const BYTE *submit_buf = NULL;
@@ -2265,9 +2487,133 @@ static BOOL xa2buffer_queue_period(XA2SourceImpl *src, XA2Buffer *buf, ALuint al
return FALSE;
}
- submit_bytes = min(src->xa2->period_frames * src->submit_blocksize, buf->cur_end_bytes - buf->offs_bytes);
- submit_buf = buf->xa2buffer.pAudioData + buf->offs_bytes;
- buf->offs_bytes += submit_bytes;
+#if HAVE_FFMPEG
+ if(src->conv_ctx){
+ DWORD scratch_offs_bytes = 0;
+ AVPacket avpkt = {0};
+
+ avpkt.size = src->fmt->nBlockAlign;
+ avpkt.data = (unsigned char*)buf->xa2buffer.pAudioData + buf->offs_bytes;
+
+ /* convert at least a period into scratch_buf */
+ while(scratch_offs_bytes < src->xa2->period_frames * src->submit_blocksize){
+ DWORD to_copy_bytes;
+
+ averr = avcodec_receive_frame(src->conv_ctx, src->conv_frame);
+ if(averr == AVERROR(EAGAIN)){
+ /* ffmpeg needs more data to decode */
+ avpkt.pts = avpkt.dts = AV_NOPTS_VALUE;
+
+ if(buf->offs_bytes >= buf->cur_end_bytes)
+ /* no more data in this buffer */
+ break;
+
+ if(buf->offs_bytes + avpkt.size + AV_INPUT_BUFFER_PADDING_SIZE > buf->cur_end_bytes){
+ UINT32 remain = buf->cur_end_bytes - buf->offs_bytes;
+ /* Unfortunately, the FFmpeg API requires that a number of
+ * extra bytes must be available past the end of the buffer.
+ * The xaudio2 client probably hasn't done this, so we have to
+ * perform a copy near the end of the buffer. */
+ TRACE("hitting end of buffer. copying %u + %u bytes into %u buffer\n",
+ remain, AV_INPUT_BUFFER_PADDING_SIZE, src->convert_bytes);
+ if(src->convert_bytes < remain + AV_INPUT_BUFFER_PADDING_SIZE){
+ src->convert_bytes = remain + AV_INPUT_BUFFER_PADDING_SIZE;
+ TRACE("buffer too small, expanding to %u\n", src->convert_bytes);
+ src->convert_buf = HeapReAlloc(GetProcessHeap(), 0, src->convert_buf, src->convert_bytes);
+ }
+ memcpy(src->convert_buf, buf->xa2buffer.pAudioData + buf->offs_bytes, remain);
+ memset(src->convert_buf + remain, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+ avpkt.data = src->convert_buf;
+ }
+
+ averr = avcodec_send_packet(src->conv_ctx, &avpkt);
+ if(averr){
+ WARN("avcodec_send_packet failed: %s\n", av_err2str(averr));
+ break;
+ }
+
+ buf->offs_bytes += avpkt.size;
+ avpkt.data += avpkt.size;
+
+ /* data sent, try receive again */
+ continue;
+ }
+
+ if(averr){
+ WARN("avcodec_receive_frame failed: %s\n", av_err2str(averr));
+ return TRUE;
+ }
+
+ to_copy_bytes = src->conv_frame->nb_samples * src->conv_ctx->channels * src->submit_blocksize;
+
+ while(scratch_offs_bytes + to_copy_bytes >= src->scratch_bytes){
+ src->scratch_bytes *= 2;
+ src->scratch_buf = HeapReAlloc(GetProcessHeap(), 0, src->scratch_buf, src->scratch_bytes);
+ }
+
+ if(av_sample_fmt_is_planar(src->conv_ctx->sample_fmt)){
+ int s, c;
+ uint8_t **source, *dst;
+ uint16_t *dst16;
+ uint32_t *dst32;
+ uint64_t *dst64;
+
+ /* one buffer per channel, but openal needs interleaved, so
+ * interleave samples into scratch buf */
+ dst = src->scratch_buf + scratch_offs_bytes;
+ source = src->conv_frame->data;
+
+ switch(src->submit_blocksize){
+ case 1:
+ for(s = 0; s < src->conv_frame->nb_samples; ++s)
+ for(c = 0; c < src->conv_ctx->channels; ++c)
+ *(dst++) = source[c][s];
+ break;
+ case 2:
+ dst16 = (uint16_t*)dst;
+ for(s = 0; s < src->conv_frame->nb_samples; ++s)
+ for(c = 0; c < src->conv_ctx->channels; ++c)
+ *(dst16++) = ((uint16_t*)(source[c]))[s];
+ break;
+ case 4:
+ dst32 = (uint32_t*)dst;
+ for(s = 0; s < src->conv_frame->nb_samples; ++s)
+ for(c = 0; c < src->conv_ctx->channels; ++c)
+ *(dst32++) = ((uint32_t*)(source[c]))[s];
+ break;
+ case 8:
+ dst64 = (uint64_t*)dst;
+ for(s = 0; s < src->conv_frame->nb_samples; ++s)
+ for(c = 0; c < src->conv_ctx->channels; ++c)
+ *(dst64++) = ((uint64_t*)(source[c]))[s];
+ break;
+ default:
+ for(s = 0; s < src->conv_frame->nb_samples; ++s)
+ for(c = 0; c < src->conv_ctx->channels; ++c){
+ memcpy(dst, &source[c][src->submit_blocksize * s], src->submit_blocksize);
+ dst += src->submit_blocksize;
+ }
+ break;
+ }
+
+ scratch_offs_bytes += to_copy_bytes;
+ }else{
+ /* copy into scratch buf */
+ memcpy(src->scratch_buf + scratch_offs_bytes, src->conv_frame->data[0], to_copy_bytes);
+ scratch_offs_bytes += to_copy_bytes;
+ }
+ }
+
+ submit_bytes = scratch_offs_bytes;
+ submit_buf = src->scratch_buf;
+ }else{
+#endif
+ submit_bytes = min(src->xa2->period_frames * src->submit_blocksize, buf->cur_end_bytes - buf->offs_bytes);
+ submit_buf = buf->xa2buffer.pAudioData + buf->offs_bytes;
+ buf->offs_bytes += submit_bytes;
+#if HAVE_FFMPEG
+ }
+#endif
alBufferData(al_buf, src->al_fmt, submit_buf, submit_bytes,
src->fmt->nSamplesPerSec);
@@ -2290,6 +2636,10 @@ static UINT32 get_underrun_warning(XA2SourceImpl *src)
UINT32 period_bytes = src->xa2->period_frames * src->submit_blocksize;
UINT32 total = 0, i;
+ if(IS_WMA(src->fmt->wFormatTag))
+ /* PCM only */
+ return 0;
+
for(i = 0; i < src->nbufs && total < IN_AL_PERIODS * period_bytes; ++i){
XA2Buffer *buf = &src->buffers[(src->first_buf + i) % XAUDIO2_MAX_QUEUED_BUFFERS];
total += buf->cur_end_bytes - buf->offs_bytes;
diff --git a/dlls/xaudio2_7/xaudio_private.h b/dlls/xaudio2_7/xaudio_private.h
index 5d3814fb9..9cf7f003c 100644
--- a/dlls/xaudio2_7/xaudio_private.h
+++ b/dlls/xaudio2_7/xaudio_private.h
@@ -29,6 +29,10 @@
#include "mmdeviceapi.h"
#include "audioclient.h"
+#if HAVE_FFMPEG
+#include <libavcodec/avcodec.h>
+#endif
+
#include <AL/al.h>
#include <AL/alc.h>
#include <AL/alext.h>
@@ -83,6 +87,11 @@ typedef struct _XA2SourceImpl {
ALuint al_bufs[XAUDIO2_MAX_QUEUED_BUFFERS];
DWORD first_al_buf, al_bufs_used, abandoned_albufs;
+#if HAVE_FFMPEG
+ AVCodecContext *conv_ctx;
+ AVFrame *conv_frame;
+#endif
+
struct list entry;
} XA2SourceImpl;
diff --git a/dlls/xaudio2_8/Makefile.in b/dlls/xaudio2_8/Makefile.in
index d4efc41d5..8ad071f48 100644
--- a/dlls/xaudio2_8/Makefile.in
+++ b/dlls/xaudio2_8/Makefile.in
@@ -1,7 +1,8 @@
EXTRADEFS = -DXAUDIO2_VER=8
MODULE = xaudio2_8.dll
IMPORTS = advapi32 ole32 user32 uuid
-EXTRALIBS = $(OPENAL_LIBS)
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/dlls/xaudio2_9/Makefile.in b/dlls/xaudio2_9/Makefile.in
index ceb2216f5..0243ed674 100644
--- a/dlls/xaudio2_9/Makefile.in
+++ b/dlls/xaudio2_9/Makefile.in
@@ -1,7 +1,8 @@
EXTRADEFS = -DXAUDIO2_VER=9
MODULE = xaudio2_9.dll
IMPORTS = advapi32 ole32 user32 uuid
-EXTRALIBS = $(OPENAL_LIBS)
+EXTRALIBS = $(OPENAL_LIBS) $(LIBAVCODEC_LIBS) $(LIBAVUTIL_LIBS)
+EXTRAINCL = $(LIBAVCODEC_CFLAGS) $(LIBAVUTIL_CFLAGS)
PARENTSRC = ../xaudio2_7
C_SRCS = \
diff --git a/include/config.h.in b/include/config.h.in
index a4cc23111..5c26873f2 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -381,6 +381,15 @@
/* Define to 1 if you have the `lgammaf' function. */
#undef HAVE_LGAMMAF
+/* Define to 1 if you have the <libavcodec/avcodec.h> header file. */
+#undef HAVE_LIBAVCODEC_AVCODEC_H
+
+/* Define to 1 if you have the <libavutil/avutil.h> header file. */
+#undef HAVE_LIBAVUTIL_AVUTIL_H
+
+/* Define to 1 if you have libavutil and libavcodec from ffmpeg. */
+#undef HAVE_FFMPEG
+
/* Define to 1 if you have the `gettextpo' library (-lgettextpo). */
#undef HAVE_LIBGETTEXTPO
--
2.20.1

View File

@ -1,2 +0,0 @@
Fixes: [39402] Use ffmpeg 4.x to convert WMA format
Depends: xaudio2-revert

View File

@ -1,25 +0,0 @@
From 69a209f88bb8a21ec48638e6d6b6f805a258d788 Mon Sep 17 00:00:00 2001
From: Thomas Crider <gloriouseggroll@gmail.com>
Date: Fri, 13 Apr 2018 18:09:21 -0400
Subject: [PATCH] xaudio2: Return S_OK in IXAudio2 in CommitChanges
---
dlls/xaudio2_7/xaudio_dll.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c
index 28cf985..647d2fd 100644
--- a/dlls/xaudio2_7/xaudio_dll.c
+++ b/dlls/xaudio2_7/xaudio_dll.c
@@ -1895,7 +1895,7 @@ static HRESULT WINAPI IXAudio2Impl_CommitChanges(IXAudio2 *iface,
TRACE("(%p)->(0x%x): stub!\n", This, operationSet);
- return E_NOTIMPL;
+ return S_OK;
}
static void WINAPI IXAudio2Impl_GetPerformanceData(IXAudio2 *iface,
--
1.9.1

View File

@ -1,2 +0,0 @@
Fixes: [44883] Return S_OK from IXAudio2Impl_CommitChanges()
Depends: xaudio2-revert