Commit 940adfdd authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfplat/mediatype: Do not add user data when converting from WAVE_FORMAT_EXTENSIBLE.

parent c512748e
......@@ -3011,7 +3011,7 @@ HRESULT WINAPI MFInitMediaTypeFromWaveFormatEx(IMFMediaType *mediatype, const WA
mediatype_set_uint32(mediatype, &MF_MT_ALL_SAMPLES_INDEPENDENT, 1, &hr);
}
if (format->cbSize)
if (format->cbSize && format->wFormatTag != WAVE_FORMAT_EXTENSIBLE)
mediatype_set_blob(mediatype, &MF_MT_USER_DATA, (const UINT8 *)(format + 1), format->cbSize, &hr);
return hr;
......
......@@ -5625,9 +5625,13 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void)
waveformatext.dwChannelMask = 0x8;
memcpy(&waveformatext.SubFormat, &MFAudioFormat_Base, sizeof(waveformatext.SubFormat));
waveformatext.SubFormat.Data1 = waveformatex_tests[i].wFormatTag;
hr = MFInitMediaTypeFromWaveFormatEx(mediatype, &waveformatext.Format, sizeof(waveformatext));
ok(hr == S_OK, "Failed to initialize media type, hr %#x.\n", hr);
hr = IMFMediaType_GetItem(mediatype, &MF_MT_USER_DATA, NULL);
ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#x.\n", hr);
validate_media_type(mediatype, &waveformatext.Format);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment