diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 3979853b8b5..b6757fa76a8 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -500,20 +500,7 @@ static HRESULT WINAPI DSoundRender_BreakConnect(struct strmbase_renderer *iface) static HRESULT WINAPI DSoundRender_EndOfStream(struct strmbase_renderer *iface) { DSoundRenderImpl *This = impl_from_strmbase_renderer(iface); - HRESULT hr; - - TRACE("(%p)->()\n",iface); - - hr = BaseRendererImpl_EndOfStream(iface); - if (hr != S_OK) - { - ERR("%08x\n", hr); - return hr; - } - - hr = DSoundRender_HandleEndOfStream(This); - - return hr; + return DSoundRender_HandleEndOfStream(This); } static HRESULT WINAPI DSoundRender_EndFlush(struct strmbase_renderer *iface) diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 5aee4380f23..50bd33715d1 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -82,18 +82,29 @@ static HRESULT WINAPI BaseRenderer_InputPin_Disconnect(IPin * iface) static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface) { - struct strmbase_renderer *pFilter = impl_from_IPin(iface); - HRESULT hr; + struct strmbase_renderer *filter = impl_from_IPin(iface); + IFilterGraph *graph = filter->filter.filterInfo.pGraph; + IMediaEventSink *event_sink; + HRESULT hr = S_OK; TRACE("iface %p.\n", iface); - EnterCriticalSection(&pFilter->csRenderLock); - pFilter->eos = TRUE; - if (pFilter->pFuncsTable->pfnEndOfStream) - hr = pFilter->pFuncsTable->pfnEndOfStream(pFilter); - else - hr = BaseRendererImpl_EndOfStream(pFilter); - LeaveCriticalSection(&pFilter->csRenderLock); + EnterCriticalSection(&filter->csRenderLock); + filter->eos = TRUE; + + if (graph && SUCCEEDED(IFilterGraph_QueryInterface(graph, + &IID_IMediaEventSink, (void **)&event_sink))) + { + IMediaEventSink_Notify(event_sink, EC_COMPLETE, S_OK, + (LONG_PTR)&filter->filter.IBaseFilter_iface); + IMediaEventSink_Release(event_sink); + } + RendererPosPassThru_EOS(filter->pPosition); + SetEvent(filter->state_event); + + if (filter->pFuncsTable->pfnEndOfStream) + hr = filter->pFuncsTable->pfnEndOfStream(filter); + LeaveCriticalSection(&filter->csRenderLock); return hr; } @@ -458,29 +469,6 @@ static const IBaseFilterVtbl strmbase_renderer_vtbl = BaseFilterImpl_QueryVendorInfo }; -HRESULT WINAPI BaseRendererImpl_EndOfStream(struct strmbase_renderer *iface) -{ - IMediaEventSink* pEventSink; - IFilterGraph *graph; - HRESULT hr = S_OK; - - TRACE("(%p)\n", iface); - - graph = iface->filter.filterInfo.pGraph; - if (graph) - { hr = IFilterGraph_QueryInterface(iface->filter.filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink); - if (SUCCEEDED(hr)) - { - hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, (LONG_PTR)iface); - IMediaEventSink_Release(pEventSink); - } - } - RendererPosPassThru_EOS(iface->pPosition); - SetEvent(iface->state_event); - - return hr; -} - HRESULT WINAPI BaseRendererImpl_ClearPendingSample(struct strmbase_renderer *iface) { if (iface->pMediaSample) diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 1dbc9ea4d8c..b08303f93dc 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -568,7 +568,6 @@ struct strmbase_renderer_ops }; HRESULT WINAPI BaseRendererImpl_ClearPendingSample(struct strmbase_renderer *filter); -HRESULT WINAPI BaseRendererImpl_EndOfStream(struct strmbase_renderer *filter); HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *filter, IMediaSample *sample); HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer,