Commit 710cc2bc authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mf/samplegrabber: Test shutdown state under the lock for methods that modify item queue.

parent 7a44796d
...@@ -407,12 +407,11 @@ static HRESULT WINAPI sample_grabber_stream_ProcessSample(IMFStreamSink *iface, ...@@ -407,12 +407,11 @@ static HRESULT WINAPI sample_grabber_stream_ProcessSample(IMFStreamSink *iface,
if (!sample) if (!sample)
return S_OK; return S_OK;
if (grabber->is_shut_down)
return MF_E_STREAMSINK_REMOVED;
EnterCriticalSection(&grabber->cs); EnterCriticalSection(&grabber->cs);
if (grabber->state == SINK_STATE_RUNNING) if (grabber->is_shut_down)
hr = MF_E_STREAMSINK_REMOVED;
else if (grabber->state == SINK_STATE_RUNNING)
{ {
hr = IMFSample_GetSampleTime(sample, &sampletime); hr = IMFSample_GetSampleTime(sample, &sampletime);
...@@ -479,12 +478,11 @@ static HRESULT WINAPI sample_grabber_stream_PlaceMarker(IMFStreamSink *iface, MF ...@@ -479,12 +478,11 @@ static HRESULT WINAPI sample_grabber_stream_PlaceMarker(IMFStreamSink *iface, MF
TRACE("%p, %d, %p, %p.\n", iface, marker_type, marker_value, context_value); TRACE("%p, %d, %p, %p.\n", iface, marker_type, marker_value, context_value);
if (grabber->is_shut_down)
return MF_E_STREAMSINK_REMOVED;
EnterCriticalSection(&grabber->cs); EnterCriticalSection(&grabber->cs);
if (grabber->state == SINK_STATE_RUNNING) if (grabber->is_shut_down)
hr = MF_E_STREAMSINK_REMOVED;
else if (grabber->state == SINK_STATE_RUNNING)
hr = stream_place_marker(grabber, marker_type, context_value); hr = stream_place_marker(grabber, marker_type, context_value);
LeaveCriticalSection(&grabber->cs); LeaveCriticalSection(&grabber->cs);
......
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