Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/mediatype.c | 7 ++++--- dlls/mfplat/tests/mfplat.c | 13 +++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 893eb3e778..382f066327 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -514,13 +514,14 @@ static HRESULT WINAPI mediatype_IsEqual(IMFMediaType *iface, IMFMediaType *type, PropVariantInit(&right.value); right.hr = IMFAttributes_GetItem(right.type, &MF_MT_USER_DATA, &right.value);
- if (SUCCEEDED(left.hr) && SUCCEEDED(left.hr)) + /* Compare user data if both types have it, otherwise simply check if both don't. */ + if (SUCCEEDED(left.hr) && SUCCEEDED(right.hr)) { result = FALSE; IMFAttributes_CompareItem(left.type, &MF_MT_USER_DATA, &left.value, &result); } - else if (FAILED(left.hr) && FAILED(left.hr)) - result = TRUE; + else + result = FAILED(left.hr) && FAILED(right.hr);
PropVariantClear(&left.value); PropVariantClear(&right.value); diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 6800441ba2..896cd93a46 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -762,6 +762,19 @@ if(0) ok(flags == (MF_MEDIATYPE_EQUAL_MAJOR_TYPES | MF_MEDIATYPE_EQUAL_FORMAT_TYPES | MF_MEDIATYPE_EQUAL_FORMAT_DATA | MF_MEDIATYPE_EQUAL_FORMAT_USER_DATA), "Unexpected flags %#x.\n", flags);
+ /* Different user data. */ + hr = IMFMediaType_SetBlob(mediatype, &MF_MT_USER_DATA, (const UINT8 *)&flags, sizeof(flags)); + ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr); + + flags = 0; + hr = IMFMediaType_IsEqual(mediatype, mediatype2, &flags); + ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr); + ok(flags == (MF_MEDIATYPE_EQUAL_MAJOR_TYPES | MF_MEDIATYPE_EQUAL_FORMAT_TYPES | MF_MEDIATYPE_EQUAL_FORMAT_DATA), + "Unexpected flags %#x.\n", flags); + + hr = IMFMediaType_DeleteItem(mediatype, &MF_MT_USER_DATA); + ok(hr == S_OK, "Failed to delete item, hr %#x.\n", hr); + hr = IMFMediaType_SetGUID(mediatype, &MF_MT_SUBTYPE, &MFVideoFormat_RGB32); ok(hr == S_OK, "Failed to set subtype, hr %#x.\n", hr);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=65374
Your paranoid android.
=== w1064v1809_2scr (32 bit report) ===
mfplat: mfplat.c:2582: Test failed: Unexpected return value 0x102. mfplat.c:1933: Test failed: Failed to get event, hr 0xc00d3e85. mfplat.c:1936: Test failed: Failed to get event, hr 0xc00d3e85. mfplat.c:1939: Test failed: Failed to finalize GetEvent, hr 0xc00d3e85. mfplat.c:1942: Test failed: Unexpected result, hr 0xc00d3e85. 1a28:mfplat: unhandled exception c0000005 at 00401AFB
=== w1064v1809_zh_CN (32 bit report) ===
mfplat: mfplat.c:2582: Test failed: Unexpected return value 0x102. mfplat.c:1933: Test failed: Failed to get event, hr 0xc00d3e85. mfplat.c:1936: Test failed: Failed to get event, hr 0xc00d3e85. mfplat.c:1939: Test failed: Failed to finalize GetEvent, hr 0xc00d3e85. mfplat.c:1942: Test failed: Unexpected result, hr 0xc00d3e85. 1990:mfplat: unhandled exception c0000005 at 00401AFB