Module: wine Branch: master Commit: 40c0dd65b071939c30137c1c820720d32d28d949 URL: https://gitlab.winehq.org/wine/wine/-/commit/40c0dd65b071939c30137c1c820720d... Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Tue Jul 9 10:33:58 2024 +0800 winegstreamer/video_encoder: Use MF_ATTRIBUTES_MATCH_INTERSECTION to compare input type. MF_MT_INTERLACE_MODE, MF_MT_VIDEO_NOMINAL_RANGE and MF_MT_PIXEL_ASPECT_RATIO are not required in input type. However, if they appears, they should match output type. --- dlls/winegstreamer/video_encoder.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/winegstreamer/video_encoder.c b/dlls/winegstreamer/video_encoder.c index ee27175ee4f..1bfe26261af 100644 --- a/dlls/winegstreamer/video_encoder.c +++ b/dlls/winegstreamer/video_encoder.c @@ -280,6 +280,7 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM struct video_encoder *encoder = impl_from_IMFTransform(iface); IMFMediaType *good_input_type; GUID major, subtype; + UINT64 ratio; BOOL result; HRESULT hr; ULONG i; @@ -317,10 +318,14 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM if (i == encoder->input_type_count) return MF_E_INVALIDMEDIATYPE; + if (FAILED(IMFMediaType_GetUINT64(type, &MF_MT_FRAME_SIZE, &ratio)) + || FAILED(IMFMediaType_GetUINT64(type, &MF_MT_FRAME_RATE, &ratio))) + return MF_E_INVALIDMEDIATYPE; + if (FAILED(hr = video_encoder_create_input_type(encoder, &subtype, &good_input_type))) return hr; hr = IMFMediaType_Compare(good_input_type, (IMFAttributes *)type, - MF_ATTRIBUTES_MATCH_OUR_ITEMS, &result); + MF_ATTRIBUTES_MATCH_INTERSECTION, &result); IMFMediaType_Release(good_input_type); if (FAILED(hr) || !result) return MF_E_INVALIDMEDIATYPE;