Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/dsoundrender.c | 3 --- dlls/strmbase/pin.c | 21 +++++++++++++-------- dlls/strmbase/renderer.c | 3 --- 3 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 7e08d90569e..4f1da6eaef3 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -509,8 +509,6 @@ static HRESULT dsound_render_sink_eos(struct strmbase_sink *iface) void *buffer; DWORD size;
- EnterCriticalSection(&filter->filter.stream_cs); - filter->eos = TRUE;
if (graph && SUCCEEDED(IFilterGraph_QueryInterface(graph, @@ -529,7 +527,6 @@ static HRESULT dsound_render_sink_eos(struct strmbase_sink *iface) memset(buffer, 0, size); IDirectSoundBuffer_Unlock(filter->dsbuffer, buffer, size, NULL, 0);
- LeaveCriticalSection(&filter->filter.stream_cs); return S_OK; }
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 54f8662e7ff..e815f7b82df 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -926,21 +926,26 @@ static HRESULT deliver_endofstream(IPin* pin, LPVOID unused)
static HRESULT WINAPI sink_EndOfStream(IPin *iface) { - struct strmbase_sink *This = impl_sink_from_IPin(iface); + struct strmbase_sink *pin = impl_sink_from_IPin(iface); HRESULT hr = S_OK;
- TRACE("pin %p %s:%s.\n", This, debugstr_w(This->pin.filter->name), debugstr_w(This->pin.name)); + TRACE("pin %p %s:%s.\n", pin, debugstr_w(pin->pin.filter->name), debugstr_w(pin->pin.name));
- if (This->pFuncsTable->sink_eos) - return This->pFuncsTable->sink_eos(This); + if (pin->pFuncsTable->sink_eos) + { + EnterCriticalSection(&pin->pin.filter->stream_cs); + hr = pin->pFuncsTable->sink_eos(pin); + LeaveCriticalSection(&pin->pin.filter->stream_cs); + return hr; + }
- EnterCriticalSection(&This->pin.filter->filter_cs); - if (This->flushing) + EnterCriticalSection(&pin->pin.filter->filter_cs); + if (pin->flushing) hr = S_FALSE; - LeaveCriticalSection(&This->pin.filter->filter_cs); + LeaveCriticalSection(&pin->pin.filter->filter_cs);
if (hr == S_OK) - hr = SendFurther(This, deliver_endofstream, NULL); + hr = SendFurther(pin, deliver_endofstream, NULL); return hr; }
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index b890ab72bf6..8da3d81de61 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -268,8 +268,6 @@ static HRESULT sink_eos(struct strmbase_sink *iface) IFilterGraph *graph = filter->filter.graph; IMediaEventSink *event_sink;
- EnterCriticalSection(&filter->filter.stream_cs); - filter->eos = TRUE;
if (graph && SUCCEEDED(IFilterGraph_QueryInterface(graph, @@ -282,7 +280,6 @@ static HRESULT sink_eos(struct strmbase_sink *iface) strmbase_passthrough_eos(&filter->passthrough); SetEvent(filter->state_event);
- LeaveCriticalSection(&filter->filter.stream_cs); return S_OK; }