Includes tests for when MFInitMediaTypeFromAMMediaType is called with major type as audio, and format type as NULL.
From: Brendan McGrath bmcgrath@codeweavers.com
Tests behaviour when major type is audio, and format is NULL. --- dlls/mfplat/tests/mfplat.c | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 752be9ea260..1564aa47349 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -12715,12 +12715,61 @@ static void test_MFInitMediaTypeFromAMMediaType(void) { &MEDIASUBTYPE_h264, &MEDIASUBTYPE_h264 }, { &MEDIASUBTYPE_H264, &MFVideoFormat_H264 }, }; + static const GUID *audio_types[] = + { + &MEDIASUBTYPE_MP3, + &MEDIASUBTYPE_MSAUDIO1, + &MEDIASUBTYPE_WMAUDIO2, + &MEDIASUBTYPE_WMAUDIO3, + &MEDIASUBTYPE_WMAUDIO_LOSSLESS, + &MEDIASUBTYPE_PCM, + &MEDIASUBTYPE_IEEE_FLOAT, + &DUMMY_CLSID, + }; MFVideoArea aperture; unsigned int i;
hr = MFCreateMediaType(&media_type); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ memset(&mt, 0, sizeof(mt)); + mt.majortype = MEDIATYPE_Audio; + + for (i = 0; i < ARRAY_SIZE(audio_types); i++) + { + mt.subtype = *audio_types[i]; + + hr = MFInitMediaTypeFromAMMediaType(media_type, &mt); + todo_wine + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IMFMediaType_GetCount(media_type, &value32); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine + ok(value32 == 4, "Unexpected value %#x.\n", value32); + + hr = IMFMediaType_GetGUID(media_type, &MF_MT_MAJOR_TYPE, &guid); + todo_wine + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine + ok(IsEqualGUID(&guid, &MFMediaType_Audio), "Unexpected guid %s.\n", debugstr_guid(&guid)); + hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &guid); + todo_wine + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine + ok(IsEqualGUID(&guid, audio_types[i]), "Unexpected guid %s.\n", debugstr_guid(&guid)); + hr = IMFMediaType_GetUINT32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, &value32); + todo_wine + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine + ok(value32 == 1, "Unexpected value %#x.\n", value32); + hr = IMFMediaType_GetGUID(media_type, &MF_MT_AM_FORMAT_TYPE, &guid); + todo_wine + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + todo_wine + ok(IsEqualGUID(&guid, &GUID_NULL), "Unexpected guid %s.\n", debugstr_guid(&guid)); + } + memset(&mt, 0, sizeof(mt)); mt.majortype = MEDIATYPE_Video; mt.formattype = FORMAT_VideoInfo;
From: Brendan McGrath bmcgrath@codeweavers.com
--- dlls/mfplat/mediatype.c | 7 +++++++ dlls/mfplat/tests/mfplat.c | 10 ---------- 2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 916ab77408d..feab99e3d8f 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -4415,6 +4415,13 @@ HRESULT WINAPI MFInitMediaTypeFromAMMediaType(IMFMediaType *media_type, const AM else if (IsEqualGUID(&am_type->formattype, &FORMAT_WaveFormatEx) && am_type->cbFormat >= sizeof(WAVEFORMATEX)) hr = MFInitMediaTypeFromWaveFormatEx(media_type, (WAVEFORMATEX *)am_type->pbFormat, am_type->cbFormat); + else if (IsEqualGUID(&am_type->formattype, &GUID_NULL)) + { + mediatype_set_guid(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio, &hr); + mediatype_set_guid(media_type, &MF_MT_SUBTYPE, &am_type->subtype, &hr); + mediatype_set_guid(media_type, &MF_MT_AM_FORMAT_TYPE, &GUID_NULL, &hr); + mediatype_set_uint32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, 1, &hr); + } else { FIXME("Unsupported format type %s / size %ld.\n", debugstr_guid(&am_type->formattype), am_type->cbFormat); diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 1564aa47349..e88760077ae 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -12740,33 +12740,23 @@ static void test_MFInitMediaTypeFromAMMediaType(void) mt.subtype = *audio_types[i];
hr = MFInitMediaTypeFromAMMediaType(media_type, &mt); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_GetCount(media_type, &value32); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine ok(value32 == 4, "Unexpected value %#x.\n", value32);
hr = IMFMediaType_GetGUID(media_type, &MF_MT_MAJOR_TYPE, &guid); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine ok(IsEqualGUID(&guid, &MFMediaType_Audio), "Unexpected guid %s.\n", debugstr_guid(&guid)); hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &guid); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine ok(IsEqualGUID(&guid, audio_types[i]), "Unexpected guid %s.\n", debugstr_guid(&guid)); hr = IMFMediaType_GetUINT32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, &value32); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine ok(value32 == 1, "Unexpected value %#x.\n", value32); hr = IMFMediaType_GetGUID(media_type, &MF_MT_AM_FORMAT_TYPE, &guid); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine ok(IsEqualGUID(&guid, &GUID_NULL), "Unexpected guid %s.\n", debugstr_guid(&guid)); }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=150200
Your paranoid android.
=== debian11 (32 bit report) ===
Report validation errors: mfplat:mfplat crashed (c0000028)
=== debian11b (32 bit WoW report) ===
Report validation errors: mfplat:mfplat crashed (c0000028)
=== debian11b (64 bit WoW report) ===
user32: win.c:4070: Test failed: Expected active window 0000000003740150, got 0000000000000000. win.c:4071: Test failed: Expected focus window 0000000003740150, got 0000000000000000.
This merge request was approved by Nikolay Sivov.