strmbase/renderer: Exit BaseRendererImpl_Receive() immediately if flush_event was signaled.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-11-21 18:11:23 -06:00 committed by Alexandre Julliard
parent 608acdc83a
commit 6072c66c5a
1 changed files with 8 additions and 1 deletions

View File

@ -394,15 +394,22 @@ HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *This, IMediaSa
if (now - This->stream_start - start <= -10000)
{
HANDLE handles[2] = {This->advise_event, This->flush_event};
DWORD ret;
IReferenceClock_AdviseTime(This->filter.pClock, This->stream_start,
start, (HEVENT)This->advise_event, &cookie);
LeaveCriticalSection(&This->csRenderLock);
WaitForMultipleObjects(2, handles, FALSE, INFINITE);
ret = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
IReferenceClock_Unadvise(This->filter.pClock, cookie);
if (ret == 1)
{
TRACE("Flush signaled, discarding current sample.\n");
return S_OK;
}
EnterCriticalSection(&This->csRenderLock);
}
}