From: Brendan McGrath bmcgrath@codeweavers.com
--- dlls/mfplat/mediatype.c | 4 ---- dlls/mfplat/tests/mfplat.c | 17 ++--------------- 2 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index feab99e3d8f..755ef7e2216 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -3005,11 +3005,7 @@ HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *mediatype, WAVE return E_INVALIDARG;
if (FAILED(hr = IMFMediaType_GetBlobSize(mediatype, &MF_MT_USER_DATA, &user_size))) - { - if (!IsEqualGUID(&subtype, &MFAudioFormat_PCM) && !IsEqualGUID(&subtype, &MFAudioFormat_Float)) - return hr; user_size = 0; - }
if (media_type_get_uint32(mediatype, &MF_MT_AUDIO_NUM_CHANNELS) > 2 && SUCCEEDED(IMFMediaType_GetItem(mediatype, &MF_MT_AUDIO_CHANNEL_MASK, NULL))) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 694cc22c847..bdaffee9e83 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -5951,15 +5951,13 @@ static void test_MFCreateWaveFormatExFromMFMediaType(void) WORD format_tag; UINT32 size; WORD size_field; - BOOL todo; - BOOL todo_size; } wave_fmt_tests[] = { { &MFAudioFormat_PCM, WAVE_FORMAT_PCM, sizeof(WAVEFORMATEX), 0, }, { &MFAudioFormat_Float, WAVE_FORMAT_IEEE_FLOAT, sizeof(WAVEFORMATEX), 0, }, - { &MFAudioFormat_MP3, WAVE_FORMAT_MPEGLAYER3, sizeof(WAVEFORMATEX), 0, TRUE, }, - { &DUMMY_GUID3, WAVE_FORMAT_EXTENSIBLE, sizeof(WAVEFORMATEXTENSIBLE), 22, TRUE, TRUE, }, + { &MFAudioFormat_MP3, WAVE_FORMAT_MPEGLAYER3, sizeof(WAVEFORMATEX), 0, }, + { &DUMMY_GUID3, WAVE_FORMAT_EXTENSIBLE, sizeof(WAVEFORMATEXTENSIBLE), 22, }, }; WAVEFORMATEXTENSIBLE *format_ext; IMFMediaType *mediatype; @@ -5992,30 +5990,23 @@ static void test_MFCreateWaveFormatExFromMFMediaType(void) ok(hr == S_OK, "Failed to set attribute, hr %#lx.\n", hr);
hr = MFCreateWaveFormatExFromMFMediaType(mediatype, &format, &size, MFWaveFormatExConvertFlag_Normal); - todo_wine_if(wave_fmt_tests[i].todo) ok(hr == S_OK, "Failed to create format, hr %#lx.\n", hr); ok(format != NULL, "Expected format structure.\n"); - todo_wine_if(wave_fmt_tests[i].todo_size) ok(size == wave_fmt_tests[i].size, "Unexpected size %u.\n", size); - todo_wine_if(wave_fmt_tests[i].todo) ok(format->wFormatTag == wave_fmt_tests[i].format_tag, "Expected tag %u, got %u.\n", wave_fmt_tests[i].format_tag, format->wFormatTag); ok(format->nChannels == 0, "Unexpected number of channels, %u.\n", format->nChannels); ok(format->nSamplesPerSec == 0, "Unexpected sample rate, %lu.\n", format->nSamplesPerSec); ok(format->nAvgBytesPerSec == 0, "Unexpected average data rate rate, %lu.\n", format->nAvgBytesPerSec); ok(format->nBlockAlign == 0, "Unexpected alignment, %u.\n", format->nBlockAlign); ok(format->wBitsPerSample == 0, "Unexpected sample size, %u.\n", format->wBitsPerSample); - todo_wine_if(wave_fmt_tests[i].todo_size) ok(format->cbSize == wave_fmt_tests[i].size_field, "Unexpected size field, %u.\n", format->cbSize); CoTaskMemFree(format);
hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&format_ext, &size, MFWaveFormatExConvertFlag_ForceExtensible); - todo_wine_if(wave_fmt_tests[i].todo) ok(hr == S_OK, "Failed to create format, hr %#lx.\n", hr); ok(format_ext != NULL, "Expected format structure.\n"); - todo_wine_if(wave_fmt_tests[i].todo) ok(size == sizeof(*format_ext), "Unexpected size %u.\n", size); - todo_wine_if(wave_fmt_tests[i].todo) ok(format_ext->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE, "Unexpected tag.\n"); ok(format_ext->Format.nChannels == 0, "Unexpected number of channels, %u.\n", format_ext->Format.nChannels); ok(format_ext->Format.nSamplesPerSec == 0, "Unexpected sample rate, %lu.\n", format_ext->Format.nSamplesPerSec); @@ -6023,15 +6014,12 @@ static void test_MFCreateWaveFormatExFromMFMediaType(void) format_ext->Format.nAvgBytesPerSec); ok(format_ext->Format.nBlockAlign == 0, "Unexpected alignment, %u.\n", format_ext->Format.nBlockAlign); ok(format_ext->Format.wBitsPerSample == 0, "Unexpected sample size, %u.\n", format_ext->Format.wBitsPerSample); - todo_wine_if(wave_fmt_tests[i].todo) ok(format_ext->Format.cbSize == sizeof(*format_ext) - sizeof(format_ext->Format), "Unexpected size field, %u.\n", format_ext->Format.cbSize); CoTaskMemFree(format_ext);
hr = MFCreateWaveFormatExFromMFMediaType(mediatype, &format, &size, MFWaveFormatExConvertFlag_ForceExtensible + 1); - todo_wine_if(wave_fmt_tests[i].todo) ok(hr == S_OK, "Failed to create format, hr %#lx.\n", hr); - todo_wine_if(wave_fmt_tests[i].todo_size) ok(size == wave_fmt_tests[i].size, "Unexpected size %u.\n", size); CoTaskMemFree(format); winetest_pop_context(); @@ -8250,7 +8238,6 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void) hr = IMFMediaType_DeleteItem(mediatype, &MF_MT_USER_DATA); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&wfx, &size, 0); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); if (hr == S_OK) {