Added xactengine3_7-Notification patchset

This commit is contained in:
Alistair Leslie-Hughes 2021-01-23 18:09:51 +11:00
parent 1830eaa655
commit 74534094a0
3 changed files with 82 additions and 0 deletions

View File

@ -327,6 +327,7 @@ patch_enable_all ()
enable_wtsapi32_EnumerateProcesses="$1"
enable_xactengine_initial="$1"
enable_xactengine2_dll="$1"
enable_xactengine3_7_Notification="$1"
enable_xactengine3_7_PrepareWave="$1"
}
@ -1069,6 +1070,9 @@ patch_enable ()
xactengine2-dll)
enable_xactengine2_dll="$2"
;;
xactengine3_7-Notification)
enable_xactengine3_7_Notification="$2"
;;
xactengine3_7-PrepareWave)
enable_xactengine3_7_PrepareWave="$2"
;;
@ -5275,6 +5279,18 @@ if test "$enable_xactengine2_dll" -eq 1; then
patch_apply xactengine2-dll/0022-xactengine2_0-New-Dll.patch
fi
# Patchset xactengine3_7-Notification
# |
# | This patchset fixes the following Wine bugs:
# | * [#50546] xactengine3_7: Send Notification after the Wavebank is created.
# |
# | Modified files:
# | * dlls/xactengine3_7/xact_dll.c
# |
if test "$enable_xactengine3_7_Notification" -eq 1; then
patch_apply xactengine3_7-Notification/0001-xactengine3.7-Delay-Notication-for-WAVEBANKPREPARED.patch
fi
# Patchset xactengine3_7-PrepareWave
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,63 @@
From e8eb785fe96281c57bbaf35f02e0e5e417bbc790 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 22 Jan 2021 18:22:41 +1100
Subject: [PATCH] xactengine3.7: Delay Notication for WAVEBANKPREPARED
---
dlls/xactengine3_7/xact_dll.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c
index 9dd52672e70..4c0d997604d 100644
--- a/dlls/xactengine3_7/xact_dll.c
+++ b/dlls/xactengine3_7/xact_dll.c
@@ -920,6 +920,26 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateInMemoryWaveBank(IXACT3Engine *ifac
return S_OK;
}
+struct thread_data
+{
+ XACT3EngineImpl *engine;
+ XACT_NOTIFICATION note;
+};
+
+static DWORD WINAPI thread_notications(LPVOID data)
+{
+ struct thread_data *tdata = data;
+
+ Sleep(1000);
+
+ FIXME("Callback XACTNOTIFICATIONTYPE_WAVEBANKPREPARED\n");
+
+ tdata->engine->notification_callback(&tdata->note);
+
+ CoTaskMemFree(data);
+ return 0;
+}
+
static HRESULT WINAPI IXACT3EngineImpl_CreateStreamingWaveBank(IXACT3Engine *iface,
const XACT_WAVEBANK_STREAMING_PARAMETERS *pParms,
IXACT3WaveBank **ppWaveBank)
@@ -963,6 +983,19 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateStreamingWaveBank(IXACT3Engine *ifa
wb->fact_wavebank = fwb;
*ppWaveBank = &wb->IXACT3WaveBank_iface;
+ if (This->notification_callback)
+ {
+ HANDLE thread;
+ struct thread_data *tdata = CoTaskMemAlloc(sizeof(struct thread_data));
+
+ tdata->engine = This;
+ tdata->note.type = XACTNOTIFICATIONTYPE_WAVEBANKPREPARED;
+ tdata->note.u.wave.pWaveBank = &wb->IXACT3WaveBank_iface;
+
+ thread = CreateThread(NULL, 0, thread_notications, tdata, 0, NULL);
+ CloseHandle(thread);
+ }
+
TRACE("Created streaming WaveBank: %p\n", wb);
return S_OK;
--
2.29.2

View File

@ -0,0 +1,3 @@
# The actual fix will involve FAudio and wine changes.
Fixes: [50546] xactengine3_7: Send Notification after the Wavebank is created.