Commit 5004b2b4 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Vitaly Lipatov

xactengine3_7: Record context for each notications

This helps the first lockup but starting a game causes another freeze. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49678Signed-off-by: 's avatarAlistair Leslie-Hughes <leslie_alistair@hotmail.com>
parent d6721355
...@@ -69,8 +69,7 @@ typedef struct _XACT3EngineImpl { ...@@ -69,8 +69,7 @@ typedef struct _XACT3EngineImpl {
XACT_GETOVERLAPPEDRESULT_CALLBACK pGetOverlappedResult; XACT_GETOVERLAPPEDRESULT_CALLBACK pGetOverlappedResult;
XACT_NOTIFICATION_CALLBACK notification_callback; XACT_NOTIFICATION_CALLBACK notification_callback;
void *wb_prepared_context; void *contexts[17];
void *wb_destroyed_context;
struct wine_rb_tree wb_wrapper_lookup; struct wine_rb_tree wb_wrapper_lookup;
CRITICAL_SECTION wb_wrapper_lookup_cs; CRITICAL_SECTION wb_wrapper_lookup_cs;
} XACT3EngineImpl; } XACT3EngineImpl;
...@@ -942,6 +941,7 @@ static void FACTCALL fact_notification_cb(const FACTNotification *notification) ...@@ -942,6 +941,7 @@ static void FACTCALL fact_notification_cb(const FACTNotification *notification)
xnotification.type = xact_notification_type_from_fact(notification->type); xnotification.type = xact_notification_type_from_fact(notification->type);
xnotification.timeStamp = notification->timeStamp; xnotification.timeStamp = notification->timeStamp;
xnotification.pvContext = engine->contexts[notification->type - 1];
if (notification->type == XACTNOTIFICATIONTYPE_WAVEBANKPREPARED if (notification->type == XACTNOTIFICATIONTYPE_WAVEBANKPREPARED
|| notification->type == XACTNOTIFICATIONTYPE_WAVEBANKDESTROYED) || notification->type == XACTNOTIFICATIONTYPE_WAVEBANKDESTROYED)
...@@ -959,10 +959,6 @@ static void FACTCALL fact_notification_cb(const FACTNotification *notification) ...@@ -959,10 +959,6 @@ static void FACTCALL fact_notification_cb(const FACTNotification *notification)
xnotification.waveBank.pWaveBank = lookup->xact; xnotification.waveBank.pWaveBank = lookup->xact;
} }
LeaveCriticalSection(&engine->wb_wrapper_lookup_cs); 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 else
{ {
...@@ -1421,12 +1417,8 @@ static HRESULT WINAPI IXACT3EngineImpl_RegisterNotification(IXACT3Engine *iface, ...@@ -1421,12 +1417,8 @@ static HRESULT WINAPI IXACT3EngineImpl_RegisterNotification(IXACT3Engine *iface,
TRACE("(%p)->(%p)\n", This, pNotificationDesc); 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); unwrap_notificationdesc(&fdesc, pNotificationDesc);
This->contexts[pNotificationDesc->type - 1] = pNotificationDesc->pvContext;
fdesc.pvContext = This; fdesc.pvContext = This;
return FACTAudioEngine_RegisterNotification(This->fact_engine, &fdesc); return FACTAudioEngine_RegisterNotification(This->fact_engine, &fdesc);
} }
...@@ -1440,6 +1432,7 @@ static HRESULT WINAPI IXACT3EngineImpl_UnRegisterNotification(IXACT3Engine *ifac ...@@ -1440,6 +1432,7 @@ static HRESULT WINAPI IXACT3EngineImpl_UnRegisterNotification(IXACT3Engine *ifac
TRACE("(%p)->(%p)\n", This, pNotificationDesc); TRACE("(%p)->(%p)\n", This, pNotificationDesc);
unwrap_notificationdesc(&fdesc, pNotificationDesc); unwrap_notificationdesc(&fdesc, pNotificationDesc);
This->contexts[pNotificationDesc->type - 1] = pNotificationDesc->pvContext;
fdesc.pvContext = This; fdesc.pvContext = This;
return FACTAudioEngine_UnRegisterNotification(This->fact_engine, &fdesc); return FACTAudioEngine_UnRegisterNotification(This->fact_engine, &fdesc);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment