Commit 480ece6a authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

strmbase: Acquire the streaming lock in sink_EndOfStream().

parent 32d33982
......@@ -465,8 +465,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,
......@@ -485,7 +483,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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment