Maarten Lankhorst : quartz: Fix a race condition in videorenderer endflush.
Alexandre Julliard
julliard at winehq.org
Tue Dec 14 10:55:42 CST 2010
Module: wine
Branch: master
Commit: 351165e30dd5afc67a9fa53cdd5aac9b07a1a910
URL: http://source.winehq.org/git/wine.git/?a=commit;h=351165e30dd5afc67a9fa53cdd5aac9b07a1a910
Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date: Fri Dec 10 16:06:56 2010 +0100
quartz: Fix a race condition in videorenderer endflush.
---
dlls/quartz/videorenderer.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c
index 6f2a860..86b9f2a 100644
--- a/dlls/quartz/videorenderer.c
+++ b/dlls/quartz/videorenderer.c
@@ -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);
More information about the wine-cvs
mailing list