Rémi Bernon (@rbernon) commented about dlls/mfreadwrite/reader.c:
+ UINT32 par_w, par_h, w, h;
- /* propagate common video attributes */ + if (advanced && SUCCEEDED(media_type_get_uint32_pair(src_type, &MF_MT_FRAME_SIZE, &w, &h)) && + FAILED(IMFMediaType_GetUINT64(dst_type, &MF_MT_FRAME_SIZE, &dst_frame_size)) && + SUCCEEDED(media_type_get_uint32_pair(src_type, &MF_MT_PIXEL_ASPECT_RATIO, &par_w, &par_h))) + { + /* Video processor should rectify the aspect ratio so the output has aspect ratio of 1:1. + * We are doing this here by explicitly changing the target frame size. + * + * Alternatively it's possible to pass along a aspect ratio of 1:1 and let winegstreamer + * handle it, but unfortunately gstreamer has a way of calcuating desired frame sizes that's + * different from Windows native. */ + + UINT64 new_h = h * par_h / par_w; + IMFMediaType_SetUINT64(dst_type, &MF_MT_FRAME_SIZE, ((UINT64)w << 32) + new_h); Should we be careful about rounding errors maybe? Are we sure that height is always the updated dimension and that width is always kept constant?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10535#note_141808