From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
This helps the first lockup but starting a game causes another freeze.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49678
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/xactengine3_7/xact_dll.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c index da2403ea9d1..9981d25a9f5 100644 --- a/dlls/xactengine3_7/xact_dll.c +++ b/dlls/xactengine3_7/xact_dll.c @@ -69,8 +69,7 @@ typedef struct _XACT3EngineImpl { XACT_GETOVERLAPPEDRESULT_CALLBACK pGetOverlappedResult; XACT_NOTIFICATION_CALLBACK notification_callback;
- void *wb_prepared_context; - void *wb_destroyed_context; + void *contexts[17]; struct wine_rb_tree wb_wrapper_lookup; CRITICAL_SECTION wb_wrapper_lookup_cs; } XACT3EngineImpl; @@ -1017,6 +1016,7 @@ static void FACTCALL fact_notification_cb(const FACTNotification *notification)
xnotification.type = xact_notification_type_from_fact(notification->type); xnotification.timeStamp = notification->timeStamp; + xnotification.pvContext = engine->contexts[notification->type - 1];
if (notification->type == XACTNOTIFICATIONTYPE_WAVEBANKPREPARED || notification->type == XACTNOTIFICATIONTYPE_WAVEBANKDESTROYED) @@ -1034,10 +1034,6 @@ static void FACTCALL fact_notification_cb(const FACTNotification *notification) xnotification.waveBank.pWaveBank = lookup->xact; } LeaveCriticalSection(&engine->wb_wrapper_lookup_cs); - if (notification->type == XACTNOTIFICATIONTYPE_WAVEBANKPREPARED) - xnotification.pvContext = engine->wb_prepared_context; - else - xnotification.pvContext = engine->wb_destroyed_context; } else { @@ -1490,12 +1486,8 @@ static HRESULT WINAPI IXACT3EngineImpl_RegisterNotification(IXACT3Engine *iface,
TRACE("(%p)->(%p)\n", This, pNotificationDesc);
- if (pNotificationDesc->type == XACTNOTIFICATIONTYPE_WAVEBANKPREPARED) - This->wb_prepared_context = pNotificationDesc->pvContext; - else if (pNotificationDesc->type == XACTNOTIFICATIONTYPE_WAVEBANKDESTROYED) - This->wb_destroyed_context = pNotificationDesc->pvContext; - unwrap_notificationdesc(&fdesc, pNotificationDesc); + This->contexts[pNotificationDesc->type - 1] = pNotificationDesc->pvContext; fdesc.pvContext = This; return FACTAudioEngine_RegisterNotification(This->fact_engine, &fdesc); } @@ -1509,6 +1501,7 @@ static HRESULT WINAPI IXACT3EngineImpl_UnRegisterNotification(IXACT3Engine *ifac TRACE("(%p)->(%p)\n", This, pNotificationDesc);
unwrap_notificationdesc(&fdesc, pNotificationDesc); + This->contexts[pNotificationDesc->type - 1] = pNotificationDesc->pvContext; fdesc.pvContext = This; return FACTAudioEngine_UnRegisterNotification(This->fact_engine, &fdesc); }