From 538b702c871aa262d117a10fb5bc02b543112981 Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Wed, 21 Apr 2021 10:20:04 -0400 Subject: [PATCH] mfplat: Add support for AudioFormat_Float in MFCreateWaveFormatExFromMFMediaType. Add support for the MFAudioFormat_Float subtype in MFCreateWaveFormatExFromMFMediaType. Signed-off-by: Connor McAdams Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/mfplat/mediatype.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index c8028b2a46f..4904dbb566f 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -2884,7 +2884,7 @@ HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *mediatype, WAVE if (!IsEqualGUID(&major, &MFMediaType_Audio)) return E_INVALIDARG; - if (!IsEqualGUID(&subtype, &MFAudioFormat_PCM)) + if (!IsEqualGUID(&subtype, &MFAudioFormat_PCM) && !IsEqualGUID(&subtype, &MFAudioFormat_Float)) { FIXME("Unsupported audio format %s.\n", debugstr_guid(&subtype)); return E_NOTIMPL; @@ -2908,7 +2908,12 @@ HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *mediatype, WAVE memset(format, 0, *size); - format->wFormatTag = format_ext ? WAVE_FORMAT_EXTENSIBLE : WAVE_FORMAT_PCM; + if (format_ext) + format->wFormatTag = WAVE_FORMAT_EXTENSIBLE; + else if (IsEqualGUID(&subtype, &MFAudioFormat_Float)) + format->wFormatTag = WAVE_FORMAT_IEEE_FLOAT; + else + format->wFormatTag = WAVE_FORMAT_PCM; if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_NUM_CHANNELS, &value))) format->nChannels = value;