strmbase: Don't drop csRenderLock in BaseRenderer_Receive().

We don't grab stream_cs to change any variables checked here, except to reset
flush_event, and that cannot result in a deadlock.

The only possible deadlocks here are:

(1) between this function and EndOfStream(), which is correct, as the two
    should presumably be serialized;

(2) between this function and EndFlush(); however, in that case we expect
    BeginFlush() first, which will unblock the streaming thread.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-11-30 23:51:35 -06:00 committed by Alexandre Julliard
parent cf366488f6
commit 6f05c69210
1 changed files with 1 additions and 4 deletions

View File

@ -224,18 +224,15 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp
IReferenceClock_AdviseTime(filter->filter.clock, filter->stream_start,
start, (HEVENT)filter->advise_event, &cookie);
LeaveCriticalSection(&filter->csRenderLock);
ret = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
IReferenceClock_Unadvise(filter->filter.clock, cookie);
if (ret == 1)
{
LeaveCriticalSection(&filter->csRenderLock);
TRACE("Flush signaled; discarding current sample.\n");
return S_OK;
}
EnterCriticalSection(&filter->csRenderLock);
}
}