From fcae0bc7550850a0b2800017045ba5121eb708c6 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 18 Mar 2019 13:01:01 +0300 Subject: [PATCH] mfreadwrite: Query presentation descriptor on reader creation. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/mfreadwrite/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index 034d5f8960b..df8f89a9d07 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -76,6 +76,7 @@ typedef struct source_reader IMFSourceReader IMFSourceReader_iface; LONG refcount; IMFMediaSource *source; + IMFPresentationDescriptor *descriptor; } srcreader; struct sink_writer @@ -135,6 +136,8 @@ static ULONG WINAPI src_reader_Release(IMFSourceReader *iface) if (!refcount) { + if (reader->descriptor) + IMFPresentationDescriptor_Release(reader->descriptor); IMFMediaSource_Release(reader->source); heap_free(reader); } @@ -279,7 +282,12 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri object->source = source; IMFMediaSource_AddRef(object->source); + if (FAILED(hr = IMFMediaSource_CreatePresentationDescriptor(object->source, &object->descriptor))) + goto failed; + hr = IMFSourceReader_QueryInterface(&object->IMFSourceReader_iface, riid, out); + +failed: IMFSourceReader_Release(&object->IMFSourceReader_iface); return hr; }