From: Santino Mazza smazza@codeweavers.com
Because the streaming thread enters the critical section when it receives an EVRM_PROCESS_INPUT message, it's possible to get into a deadlock when waiting for the streaming thread while being in the critical section. --- dlls/evr/presenter.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/evr/presenter.c b/dlls/evr/presenter.c index 06592f8766e..674bd298c33 100644 --- a/dlls/evr/presenter.c +++ b/dlls/evr/presenter.c @@ -747,8 +747,11 @@ static HRESULT video_presenter_end_streaming(struct video_presenter *presenter)
PostThreadMessageW(presenter->thread.tid, EVRM_STOP, 0, 0);
+ /* Make sure streaming thread is not blocked by critical section before waiting for it. */ + LeaveCriticalSection(&presenter->cs); WaitForSingleObject(presenter->thread.hthread, INFINITE); CloseHandle(presenter->thread.hthread); + EnterCriticalSection(&presenter->cs);
TRACE("Terminated streaming thread tid %#lx.\n", presenter->thread.tid);