1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

mfplat: Support AAC format attributes in MFInitMediaTypeFromWaveFormatEx.

This commit is contained in:
Rémi Bernon 2023-11-16 11:51:35 +01:00 committed by Alexandre Julliard
parent 96346d24c1
commit 1939bfff9f
2 changed files with 9 additions and 5 deletions

View file

@ -3124,6 +3124,15 @@ HRESULT WINAPI MFInitMediaTypeFromWaveFormatEx(IMFMediaType *mediatype, const WA
mediatype_set_uint32(mediatype, &MF_MT_ALL_SAMPLES_INDEPENDENT, 1, &hr);
}
if (IsEqualGUID(&subtype, &MFAudioFormat_AAC))
{
HEAACWAVEINFO *info = CONTAINING_RECORD(format, HEAACWAVEINFO, wfx);
if (format->cbSize < sizeof(HEAACWAVEINFO) - sizeof(WAVEFORMATEX))
return E_INVALIDARG;
mediatype_set_uint32(mediatype, &MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION, info->wAudioProfileLevelIndication, &hr);
mediatype_set_uint32(mediatype, &MF_MT_AAC_PAYLOAD_TYPE, info->wPayloadType, &hr);
}
if (format->cbSize && format->wFormatTag != WAVE_FORMAT_EXTENSIBLE)
mediatype_set_blob(mediatype, &MF_MT_USER_DATA, (const UINT8 *)(format + 1), format->cbSize, &hr);

View file

@ -7059,7 +7059,6 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void)
/* test with invalid format size */
aacformat.wfInfo.wfx.cbSize = sizeof(aacformat) - 2 - sizeof(WAVEFORMATEX);
hr = MFInitMediaTypeFromWaveFormatEx(mediatype, (WAVEFORMATEX *)&aacformat, sizeof(aacformat) - 2);
todo_wine
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
aacformat.wfInfo.wfx.cbSize = sizeof(aacformat) - sizeof(WAVEFORMATEX);
@ -7070,15 +7069,11 @@ static void test_MFInitMediaTypeFromWaveFormatEx(void)
value = 0xdeadbeef;
hr = IMFMediaType_GetUINT32(mediatype, &MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION, &value);
todo_wine
ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr);
todo_wine
ok(value == aacformat.wfInfo.wAudioProfileLevelIndication, "Unexpected AAC_AUDIO_PROFILE_LEVEL_INDICATION %u.\n", value);
value = 0xdeadbeef;
hr = IMFMediaType_GetUINT32(mediatype, &MF_MT_AAC_PAYLOAD_TYPE, &value);
todo_wine
ok(hr == S_OK, "Failed to get attribute, hr %#lx.\n", hr);
todo_wine
ok(value == aacformat.wfInfo.wPayloadType, "Unexpected AAC_PAYLOAD_TYPE %u.\n", value);
hr = IMFMediaType_GetBlob(mediatype, &MF_MT_USER_DATA, buff, sizeof(buff), &size);