On 1/4/22 20:35, Derek Lesho wrote:
failed: @@ -1297,6 +1302,7 @@ static void free_media_engine(struct media_engine *engine) } SysFreeString(engine->current_source); DeleteCriticalSection(&engine->cs);
- CloseHandle(engine->session_closed); free(engine->video_frame.buffer); free(engine); }
@@ -1956,6 +1962,8 @@ static HRESULT WINAPI media_engine_Shutdown(IMFMediaEngine *iface) else { media_engine_set_flag(engine, FLAGS_ENGINE_SHUT_DOWN, TRUE);
IMFMediaSession_Close(engine->session);
WaitForSingleObject(engine->session_closed, INFINITE); IMFMediaSession_Shutdown(engine->session); }
Could you explain what does this fix?
LeaveCriticalSection(&engine->cs);
@@ -2451,6 +2459,7 @@ static HRESULT init_media_engine(DWORD flags, IMFAttributes *attributes, struct engine->duration = NAN; engine->video_frame.pts = MINLONGLONG; InitializeCriticalSection(&engine->cs);
engine->session_closed = CreateEventW(NULL, TRUE, FALSE, NULL);
hr = IMFAttributes_GetUnknown(attributes, &MF_MEDIA_ENGINE_CALLBACK, &IID_IMFMediaEngineNotify, (void **)&engine->callback);