Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/dsoundrender.c | 2 +- dlls/quartz/videorenderer.c | 1 - dlls/strmbase/renderer.c | 16 ++++++++-------- include/wine/strmbase.h | 4 +++- 4 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index ee0473478ba..a8068da61cd 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -726,7 +726,7 @@ static HRESULT WINAPI DSoundRender_Pause(IBaseFilter * iface) if (This->renderer.filter.state == State_Stopped) { if (This->renderer.sink.pin.pConnectedTo) - ResetEvent(This->renderer.evComplete); + ResetEvent(This->renderer.state_event); This->renderer.sink.end_of_stream = 0; }
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 2121a0000bb..e905be516e0 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -51,7 +51,6 @@ typedef struct VideoRendererImpl
DWORD ThreadID; HANDLE hEvent; -/* hEvent == evComplete? */ BOOL ThreadResult; RECT SourceRect; RECT DestRect; diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index fa4f0f3c93f..0e5dd8c2fcc 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -280,7 +280,7 @@ HRESULT WINAPI strmbase_renderer_init(BaseRenderer *filter, const IBaseFilterVtb
InitializeCriticalSection(&filter->csRenderLock); filter->csRenderLock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": BaseRenderer.csRenderLock"); - filter->evComplete = CreateEventW(NULL, TRUE, TRUE, NULL); + filter->state_event = CreateEventW(NULL, TRUE, TRUE, NULL); filter->RenderEvent = CreateEventW(NULL, FALSE, FALSE, NULL); filter->pMediaSample = NULL;
@@ -304,7 +304,7 @@ void strmbase_renderer_cleanup(BaseRenderer *filter) DeleteCriticalSection(&filter->csRenderLock);
BaseRendererImpl_ClearPendingSample(filter); - CloseHandle(filter->evComplete); + CloseHandle(filter->state_event); CloseHandle(filter->RenderEvent); QualityControlImpl_Destroy(filter->qcimpl); strmbase_filter_cleanup(&filter->filter); @@ -355,7 +355,7 @@ HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSamp if (This->pFuncsTable->pfnOnReceiveFirstSample) This->pFuncsTable->pfnOnReceiveFirstSample(This, pSample);
- SetEvent(This->evComplete); + SetEvent(This->state_event); }
/* Wait for render Time */ @@ -415,7 +415,7 @@ HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter * iface) if (This->pFuncsTable->pfnOnStopStreaming) This->pFuncsTable->pfnOnStopStreaming(This); This->filter.state = State_Stopped; - SetEvent(This->evComplete); + SetEvent(This->state_event); SetEvent(This->RenderEvent); } LeaveCriticalSection(&This->csRenderLock); @@ -434,7 +434,7 @@ HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart) if (This->filter.state == State_Running) goto out;
- SetEvent(This->evComplete); + SetEvent(This->state_event);
if (This->sink.pin.pConnectedTo) { @@ -480,7 +480,7 @@ HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter * iface) if (This->filter.state == State_Stopped) { if (This->sink.pin.pConnectedTo) - ResetEvent(This->evComplete); + ResetEvent(This->state_event); This->sink.end_of_stream = FALSE; } else if (This->pFuncsTable->pfnOnStopStreaming) @@ -517,7 +517,7 @@ HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsT
TRACE("(%p)->(%d, %p)\n", This, dwMilliSecsTimeout, pState);
- if (WaitForSingleObject(This->evComplete, dwMilliSecsTimeout) == WAIT_TIMEOUT) + if (WaitForSingleObject(This->state_event, dwMilliSecsTimeout) == WAIT_TIMEOUT) hr = VFW_S_STATE_INTERMEDIATE; else hr = S_OK; @@ -545,7 +545,7 @@ HRESULT WINAPI BaseRendererImpl_EndOfStream(BaseRenderer* iface) } } RendererPosPassThru_EOS(iface->pPosition); - SetEvent(iface->evComplete); + SetEvent(iface->state_event);
return hr; } diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 5892efcf197..28a973da1ff 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -540,7 +540,9 @@ typedef struct BaseRendererTag BaseInputPin sink; IUnknown *pPosition; CRITICAL_SECTION csRenderLock; - HANDLE evComplete; + /* Signaled when the filter has completed a state change. The filter waits + * for this event in IBaseFilter::GetState(). */ + HANDLE state_event; HANDLE RenderEvent; IMediaSample *pMediaSample;