Updated xactengine3_7-Notification patchset

This commit is contained in:
Alistair Leslie-Hughes 2021-02-02 11:34:34 +11:00
parent a6054cf2e9
commit 32b29ad4d8
2 changed files with 37 additions and 23 deletions

View File

@ -1,17 +1,17 @@
From e8eb785fe96281c57bbaf35f02e0e5e417bbc790 Mon Sep 17 00:00:00 2001
From 36d84a848bcffc5e3a2d0ab4c96fe0eaac68bbbc 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
Subject: [PATCH 1/2] xactengine3.7: Delay Notication for WAVEBANKPREPARED
---
dlls/xactengine3_7/xact_dll.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
dlls/xactengine3_7/xact_dll.c | 40 +++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c
index 9dd52672e70..4c0d997604d 100644
index 281aecc154b..e3b6e32cd5a 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
@@ -883,6 +883,42 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateSoundBank(IXACT3Engine *iface,
return S_OK;
}
@ -27,7 +27,7 @@ index 9dd52672e70..4c0d997604d 100644
+
+ Sleep(1000);
+
+ FIXME("Callback XACTNOTIFICATIONTYPE_WAVEBANKPREPARED\n");
+ FIXME("Callback XACTNOTIFICATIONTYPE_WAVEBANKPREPARED (%p)\n", tdata->engine);
+
+ tdata->engine->notification_callback(&tdata->note);
+
@ -35,13 +35,8 @@ index 9dd52672e70..4c0d997604d 100644
+ 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;
+static void send_wavebank_notification(XACT3EngineImpl *This, IXACT3WaveBank *wavebank)
+{
+ if (This->notification_callback)
+ {
+ HANDLE thread;
@ -49,11 +44,30 @@ index 9dd52672e70..4c0d997604d 100644
+
+ tdata->engine = This;
+ tdata->note.type = XACTNOTIFICATIONTYPE_WAVEBANKPREPARED;
+ tdata->note.u.wave.pWaveBank = &wb->IXACT3WaveBank_iface;
+ tdata->note.u.wave.pWaveBank = wavebank;
+
+ thread = CreateThread(NULL, 0, thread_notications, tdata, 0, NULL);
+ CloseHandle(thread);
+ }
+}
+
static HRESULT WINAPI IXACT3EngineImpl_CreateInMemoryWaveBank(IXACT3Engine *iface,
const void* pvBuffer, DWORD dwSize, DWORD dwFlags,
DWORD dwAllocAttributes, IXACT3WaveBank **ppWaveBank)
@@ -915,6 +951,8 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateInMemoryWaveBank(IXACT3Engine *ifac
wb->fact_wavebank = fwb;
*ppWaveBank = &wb->IXACT3WaveBank_iface;
+ send_wavebank_notification(This, &wb->IXACT3WaveBank_iface);
+
TRACE("Created in-memory WaveBank: %p\n", wb);
return S_OK;
@@ -963,6 +1001,8 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateStreamingWaveBank(IXACT3Engine *ifa
wb->fact_wavebank = fwb;
*ppWaveBank = &wb->IXACT3WaveBank_iface;
+ send_wavebank_notification(This, &wb->IXACT3WaveBank_iface);
+
TRACE("Created streaming WaveBank: %p\n", wb);

View File

@ -1,7 +1,7 @@
From 0b8b06c2e94d23e9f6f8614073450c5598830c7d Mon Sep 17 00:00:00 2001
From 168094a26f74f785f3ee1429d5abc55be5f50c0c Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 28 Jan 2021 12:29:42 +1100
Subject: [PATCH] xactengine3_7: Record context for each notications
Subject: [PATCH 2/2] xactengine3_7: Record context for each notications
This helps the first lockup but starting a game causes another freeze.
@ -11,7 +11,7 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49678
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c
index c3c6b785094..1eda7661acc 100644
index e3b6e32cd5a..51826e81773 100644
--- a/dlls/xactengine3_7/xact_dll.c
+++ b/dlls/xactengine3_7/xact_dll.c
@@ -637,6 +637,8 @@ typedef struct _XACT3EngineImpl {
@ -23,15 +23,15 @@ index c3c6b785094..1eda7661acc 100644
} XACT3EngineImpl;
typedef struct wrap_readfile_struct {
@@ -990,6 +992,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateStreamingWaveBank(IXACT3Engine *ifa
@@ -912,6 +914,7 @@ static void send_wavebank_notification(XACT3EngineImpl *This, IXACT3WaveBank *wa
tdata->engine = This;
tdata->note.type = XACTNOTIFICATIONTYPE_WAVEBANKPREPARED;
+ tdata->note.pvContext = This->contexts[tdata->note.type - 1];
tdata->note.u.wave.pWaveBank = &wb->IXACT3WaveBank_iface;
+ tdata->note.pvContext = This->contexts[XACTNOTIFICATIONTYPE_WAVEBANKPREPARED - 1];
tdata->note.u.wave.pWaveBank = wavebank;
thread = CreateThread(NULL, 0, thread_notications, tdata, 0, NULL);
@@ -1239,9 +1242,11 @@ static HRESULT WINAPI IXACT3EngineImpl_RegisterNotification(IXACT3Engine *iface,
@@ -1131,9 +1134,11 @@ static HRESULT WINAPI IXACT3EngineImpl_RegisterNotification(IXACT3Engine *iface,
XACT3EngineImpl *This = impl_from_IXACT3Engine(iface);
FACTNotificationDescription fdesc;
@ -44,7 +44,7 @@ index c3c6b785094..1eda7661acc 100644
fdesc.pvContext = This;
return FACTAudioEngine_RegisterNotification(This->fact_engine, &fdesc);
}
@@ -1255,6 +1260,8 @@ static HRESULT WINAPI IXACT3EngineImpl_UnRegisterNotification(IXACT3Engine *ifac
@@ -1147,6 +1152,8 @@ static HRESULT WINAPI IXACT3EngineImpl_UnRegisterNotification(IXACT3Engine *ifac
TRACE("(%p)->(%p)\n", This, pNotificationDesc);
unwrap_notificationdesc(&fdesc, pNotificationDesc);