Commit 4e410f07 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfreadwrite/writer: Reference user callback.

parent 862ac14e
......@@ -83,6 +83,8 @@ struct sink_writer
HRESULT status;
MF_SINK_WRITER_STATISTICS stats;
IMFSinkWriterCallback *callback;
CRITICAL_SECTION cs;
};
......@@ -215,6 +217,8 @@ static ULONG WINAPI sink_writer_Release(IMFSinkWriter *iface)
IMFPresentationClock_Release(writer->clock);
if (writer->sink)
IMFMediaSink_Release(writer->sink);
if (writer->callback)
IMFSinkWriterCallback_Release(writer->callback);
for (i = 0; i < writer->streams.count; ++i)
{
struct stream *stream = &writer->streams.items[i];
......@@ -885,6 +889,12 @@ HRESULT create_sink_writer_from_sink(IMFMediaSink *sink, IMFAttributes *attribut
object->stats.cb = sizeof(object->stats);
InitializeCriticalSection(&object->cs);
if (attributes)
{
IMFAttributes_GetUnknown(attributes, &MF_SINK_WRITER_ASYNC_CALLBACK,
&IID_IMFSinkWriterCallback, (void **)&object->callback);
}
if (FAILED(hr = sink_writer_initialize_existing_streams(object, sink)))
{
IMFSinkWriter_Release(&object->IMFSinkWriter_iface);
......
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