Commit c6121962 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mf: Query for optional event generator for sinks.

parent 4fc32ab6
......@@ -107,6 +107,7 @@ struct media_sink
{
struct list entry;
IMFMediaSink *sink;
IMFMediaEventGenerator *event_generator;
};
struct output_node
......@@ -573,13 +574,14 @@ static void session_clear_presentation(struct media_session *session)
heap_free(src_node);
}
LIST_FOR_EACH_ENTRY_SAFE(sink, sink2, &session->presentation.sinks, struct media_sink, entry)
{
list_remove(&sink->entry);
if (sink->sink)
IMFMediaSink_Release(sink->sink);
if (sink->event_generator)
IMFMediaEventGenerator_Release(sink->event_generator);
heap_free(sink);
}
}
......@@ -812,6 +814,8 @@ static HRESULT session_add_media_sink(struct media_session *session, IMFTopology
media_sink->sink = sink;
IMFMediaSink_AddRef(media_sink->sink);
IMFMediaSink_QueryInterface(media_sink->sink, &IID_IMFMediaEventGenerator, (void **)&media_sink->event_generator);
list_add_tail(&session->presentation.sinks, &media_sink->entry);
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