Commit 351165e3 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

quartz: Fix a race condition in videorenderer endflush.

parent b353f324
......@@ -432,6 +432,7 @@ static HRESULT WINAPI VideoRenderer_Receive(BaseInputPin* pin, IMediaSample * pS
LeaveCriticalSection(&This->filter.csFilter);
WaitForSingleObject(This->blocked, INFINITE);
EnterCriticalSection(&This->filter.csFilter);
SetEvent(This->hEvent);
This->sample_held = NULL;
if (This->filter.state == State_Paused)
{
......@@ -959,6 +960,15 @@ static HRESULT WINAPI VideoRenderer_InputPin_EndFlush(IPin * iface)
TRACE("(%p/%p)->()\n", This, iface);
EnterCriticalSection(This->pin.pCritSec);
if (pVideoRenderer->sample_held) {
SetEvent(pVideoRenderer->blocked);
ResetEvent(pVideoRenderer->hEvent);
LeaveCriticalSection(This->pin.pCritSec);
WaitForSingleObject(pVideoRenderer->hEvent, INFINITE);
EnterCriticalSection(This->pin.pCritSec);
ResetEvent(pVideoRenderer->blocked);
}
if (pVideoRenderer->filter.state == State_Paused) {
ResetEvent(pVideoRenderer->blocked);
ResetEvent(pVideoRenderer->hEvent);
......
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