mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 17:27:18 +00:00
mfmediaengine: Don't send event notify when engine is shutdown.
I've also tried saving a cancel cookie from `BeginCreateObject*` and using it to cancel the operation in engine shutdown. However there are 2 problems: 1. Callback might still get called after `CancelObjectCreation`. Microsoft's [own documentation](https://learn.microsoft.com/en-us/windows/win32/api/mfidl/nf-mfidl-imfsourceresolver-cancelobjectcreation) says as much: > Because these methods are asynchronous, however, they might be completed before the > operation can be canceled. Therefore, your callback might still be invoked after you > call this method. 2. Our implementations of `BeginCreateObject*` are not cancellable. They call either `MFPutWorkItem` or `IMFByteStream_BeginRead`, neight of which provides cancellation. (and our `CancelObjectCreation` doesn't actually work. AsyncResult objects aren't added to `handler->results` list until they are completed, which means any attempts to cancel an yet-to-be-completed object creation will always fail with `MF_E_UNEXPECTED`)
This commit is contained in:
parent
d0400e5637
commit
e8943a6463
|
@ -1356,6 +1356,12 @@ static HRESULT WINAPI media_engine_load_handler_Invoke(IMFAsyncCallback *iface,
|
|||
|
||||
EnterCriticalSection(&engine->cs);
|
||||
|
||||
if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
|
||||
{
|
||||
LeaveCriticalSection(&engine->cs);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
engine->network_state = MF_MEDIA_ENGINE_NETWORK_LOADING;
|
||||
IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_LOADSTART, 0, 0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue