Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/mediatype.c | 3 ++- dlls/mfplat/tests/mfplat.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index aaf0714bdd..e522e90f01 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -1616,7 +1616,8 @@ static HRESULT WINAPI presentation_descriptor_Clone(IMFPresentationDescriptor *i object->descriptors[i] = presentation_desc->descriptors[i]; IMFStreamDescriptor_AddRef(object->descriptors[i].descriptor); } - /* FIXME: copy attributes */ + + attributes_CopyAllItems(&presentation_desc->attributes, (IMFAttributes *)&object->IMFPresentationDescriptor_iface);
LeaveCriticalSection(&presentation_desc->cs);
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 541b236731..b349c51af3 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -2289,6 +2289,7 @@ static void test_presentation_descriptor(void) IMFMediaType *media_type; unsigned int i; BOOL selected; + UINT64 value; DWORD count; HRESULT hr;
@@ -2330,14 +2331,24 @@ static void test_presentation_descriptor(void) ok(!!selected, "Unexpected selected state.\n"); IMFStreamDescriptor_Release(stream_desc2);
+ hr = IMFPresentationDescriptor_SetUINT64(pd, &MF_PD_TOTAL_FILE_SIZE, 1); + ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr); + hr = IMFPresentationDescriptor_Clone(pd, &pd2); ok(hr == S_OK, "Failed to clone, hr %#x.\n", hr);
hr = IMFPresentationDescriptor_GetStreamDescriptorByIndex(pd2, 0, &selected, &stream_desc2); ok(hr == S_OK, "Failed to get stream descriptor, hr %#x.\n", hr); ok(!!selected, "Unexpected selected state.\n"); + ok(stream_desc2 == stream_desc[0], "Unexpected stream descriptor.\n"); IMFStreamDescriptor_Release(stream_desc2);
+ value = 0; + hr = IMFPresentationDescriptor_GetUINT64(pd2, &MF_PD_TOTAL_FILE_SIZE, &value); + ok(hr == S_OK, "Failed to get attribute, hr %#x.\n", hr); + ok(value == 1, "Unexpected attribute value.\n"); + + IMFPresentationDescriptor_Release(pd2); IMFPresentationDescriptor_Release(pd);
for (i = 0; i < ARRAY_SIZE(stream_desc); ++i)