Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/samplegrabber.c | 13 +++++++++++++ dlls/mf/tests/mf.c | 1 - 2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/mf/samplegrabber.c b/dlls/mf/samplegrabber.c index f4dbe4f283..82febf236d 100644 --- a/dlls/mf/samplegrabber.c +++ b/dlls/mf/samplegrabber.c @@ -235,6 +235,9 @@ static HRESULT WINAPI sample_grabber_stream_GetEvent(IMFStreamSink *iface, DWORD
TRACE("%p, %#x, %p.\n", iface, flags, event);
+ if (!stream->sink) + return MF_E_STREAMSINK_REMOVED; + return IMFMediaEventQueue_GetEvent(stream->event_queue, flags, event); }
@@ -245,6 +248,9 @@ static HRESULT WINAPI sample_grabber_stream_BeginGetEvent(IMFStreamSink *iface,
TRACE("%p, %p, %p.\n", iface, callback, state);
+ if (!stream->sink) + return MF_E_STREAMSINK_REMOVED; + return IMFMediaEventQueue_BeginGetEvent(stream->event_queue, callback, state); }
@@ -255,6 +261,9 @@ static HRESULT WINAPI sample_grabber_stream_EndGetEvent(IMFStreamSink *iface, IM
TRACE("%p, %p, %p.\n", iface, result, event);
+ if (!stream->sink) + return MF_E_STREAMSINK_REMOVED; + return IMFMediaEventQueue_EndGetEvent(stream->event_queue, result, event); }
@@ -265,6 +274,9 @@ static HRESULT WINAPI sample_grabber_stream_QueueEvent(IMFStreamSink *iface, Med
TRACE("%p, %u, %s, %#x, %p.\n", iface, event_type, debugstr_guid(ext_type), hr, value);
+ if (!stream->sink) + return MF_E_STREAMSINK_REMOVED; + return IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, event_type, ext_type, hr, value); }
@@ -1046,6 +1058,7 @@ static HRESULT WINAPI sample_grabber_sink_Shutdown(IMFMediaSink *iface) IMFMediaSink_Release(&grabber->stream->sink->IMFMediaSink_iface); EnterCriticalSection(&grabber->stream->cs); grabber->stream->sink = NULL; + IMFMediaEventQueue_Shutdown(grabber->stream->event_queue); LeaveCriticalSection(&grabber->stream->cs); IMFStreamSink_Release(&grabber->stream->IMFStreamSink_iface); grabber->stream = NULL; diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index ebab86aab6..0593ed8868 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -2162,7 +2162,6 @@ todo_wine ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
hr = IMFStreamSink_GetEvent(stream, MF_EVENT_FLAG_NO_WAIT, &event); -todo_wine ok(hr == MF_E_STREAMSINK_REMOVED, "Unexpected hr %#x.\n", hr);
hr = IMFStreamSink_GetMediaSink(stream, &sink2);