Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/mfplat/buffer.c | 7 ++++--- dlls/mfplat/main.c | 8 +++++--- dlls/mfplat/mediatype.c | 16 ++++++++++------ 3 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index 9081dc39eab..f161bb29d80 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -49,7 +49,7 @@ struct buffer struct { BYTE *linear_buffer; - unsigned int plane_size; + DWORD plane_size;
BYTE *scanline0; unsigned int width; @@ -1306,9 +1306,10 @@ static p_copy_image_func get_2d_buffer_copy_func(DWORD fourcc)
static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bottom_up, IMFMediaBuffer **buffer) { - unsigned int stride, max_length, plane_size; - struct buffer *object; + unsigned int stride, max_length; unsigned int row_alignment; + struct buffer *object; + DWORD plane_size; GUID subtype; BOOL is_yuv; HRESULT hr; diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index e2f892ed91d..e79f59d41dd 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -702,9 +702,10 @@ static HRESULT register_transform(const CLSID *clsid, const WCHAR *name, UINT32 HRESULT hr = S_OK; HKEY hclsid = 0; WCHAR buffer[64]; - DWORD size, ret; WCHAR str[250]; UINT8 *blob; + UINT32 size; + DWORD ret;
guid_to_string(buffer, clsid); swprintf(str, ARRAY_SIZE(str), L"%s\%s", transform_keyW, buffer); @@ -6094,8 +6095,9 @@ static const IRtwqAsyncCallbackVtbl source_resolver_callback_url_vtbl =
static HRESULT resolver_create_registered_handler(HKEY hkey, REFIID riid, void **handler) { - unsigned int j = 0, name_length, type; + DWORD name_length, type; HRESULT hr = E_FAIL; + unsigned int j = 0; WCHAR clsidW[39]; CLSID clsid;
@@ -9207,7 +9209,7 @@ static ULONGLONG lldiv128(ULARGE_INTEGER c1, ULARGE_INTEGER c0, LONGLONG denom) { ULARGE_INTEGER q1, q0, rhat; ULARGE_INTEGER v, cmp1, cmp2; - unsigned int s = 0; + DWORD s = 0;
v.QuadPart = llabs(denom);
diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 4f24ccbd237..c20e0c68235 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -2926,8 +2926,10 @@ HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *mediatype, WAVE
if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_NUM_CHANNELS, &value))) format->nChannels = value; - IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &format->nSamplesPerSec); - IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, &format->nAvgBytesPerSec); + if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &value))) + format->nSamplesPerSec = value; + if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, &value))) + format->nAvgBytesPerSec = value; if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &value))) format->nBlockAlign = value; if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_BITS_PER_SAMPLE, &value))) @@ -2939,7 +2941,8 @@ HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *mediatype, WAVE if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_VALID_BITS_PER_SAMPLE, &value))) format_ext->Samples.wSamplesPerBlock = value;
- IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_CHANNEL_MASK, &format_ext->dwChannelMask); + if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_CHANNEL_MASK, &value))) + format_ext->dwChannelMask = value; memcpy(&format_ext->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM, sizeof(format_ext->SubFormat)); }
@@ -3085,8 +3088,8 @@ HRESULT WINAPI MFCreateAudioMediaType(const WAVEFORMATEX *format, IMFAudioMediaT return S_OK; }
-static void media_type_get_ratio(IMFMediaType *media_type, const GUID *attr, UINT32 *numerator, - UINT32 *denominator) +static void media_type_get_ratio(IMFMediaType *media_type, const GUID *attr, DWORD *numerator, + DWORD *denominator) { UINT64 value;
@@ -3166,7 +3169,8 @@ HRESULT WINAPI MFCreateMFVideoFormatFromMFMediaType(IMFMediaType *media_type, MF format->compressedInfo.AvgBitrate = avgrate; if (SUCCEEDED(IMFMediaType_GetUINT32(media_type, &MF_MT_AVG_BIT_ERROR_RATE, &avgrate))) format->compressedInfo.AvgBitErrorRate = avgrate; - IMFMediaType_GetUINT32(media_type, &MF_MT_MAX_KEYFRAME_SPACING, &format->compressedInfo.MaxKeyFrameSpacing); + if (SUCCEEDED(IMFMediaType_GetUINT32(media_type, &MF_MT_MAX_KEYFRAME_SPACING, &avgrate))) + format->compressedInfo.MaxKeyFrameSpacing = avgrate;
/* Palette. */ if (palette_size)