Nikolay Sivov : evr/presenter: Remove logic related to picture aspect ratio adjustment.

Alexandre Julliard julliard at winehq.org
Mon Nov 8 15:45:06 CST 2021


Module: wine
Branch: master
Commit: 7462d77f0b8e53ac1c425b7d3e4beac39d0de594
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=7462d77f0b8e53ac1c425b7d3e4beac39d0de594

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Nov  8 14:57:02 2021 +0300

evr/presenter: Remove logic related to picture aspect ratio adjustment.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/evr/presenter.c | 35 +----------------------------------
 1 file changed, 1 insertion(+), 34 deletions(-)

diff --git a/dlls/evr/presenter.c b/dlls/evr/presenter.c
index 0381cb3e593..5f70d173c0b 100644
--- a/dlls/evr/presenter.c
+++ b/dlls/evr/presenter.c
@@ -483,8 +483,6 @@ static void video_presenter_sample_present(struct video_presenter *presenter, IM
 {
     IDirect3DSurface9 *surface, *backbuffer;
     IDirect3DDevice9 *device;
-    D3DSURFACE_DESC desc;
-    RECT dst, src;
     HRESULT hr;
 
     if (!presenter->swapchain)
@@ -506,38 +504,7 @@ static void video_presenter_sample_present(struct video_presenter *presenter, IM
     IDirect3DSwapChain9_GetDevice(presenter->swapchain, &device);
     IDirect3DDevice9_StretchRect(device, surface, NULL, backbuffer, NULL, D3DTEXF_POINT);
 
-    IDirect3DSurface9_GetDesc(surface, &desc);
-    SetRect(&src, 0, 0, desc.Width, desc.Height);
-
-    IDirect3DSurface9_GetDesc(backbuffer, &desc);
-    SetRect(&dst, 0, 0, desc.Width, desc.Height);
-
-    if (presenter->ar_mode & MFVideoARMode_PreservePicture)
-    {
-        unsigned int src_width = src.right - src.left, src_height = src.bottom - src.top;
-        unsigned int dst_width = dst.right - dst.left, dst_height = dst.bottom - dst.top;
-
-        if (src_width * dst_height > dst_width * src_height)
-        {
-            /* src is "wider" than dst. */
-            unsigned int dst_center = (dst.top + dst.bottom) / 2;
-            unsigned int scaled_height = src_height * dst_width / src_width;
-
-            dst.top = dst_center - scaled_height / 2;
-            dst.bottom = dst.top + scaled_height;
-        }
-        else if (src_width * dst_height < dst_width * src_height)
-        {
-            /* src is "taller" than dst. */
-            unsigned int dst_center = (dst.left + dst.right) / 2;
-            unsigned int scaled_width = src_width * dst_height / src_height;
-
-            dst.left = dst_center - scaled_width / 2;
-            dst.right = dst.left + scaled_width;
-        }
-    }
-
-    IDirect3DSwapChain9_Present(presenter->swapchain, &src, &dst, NULL, NULL, 0);
+    IDirect3DSwapChain9_Present(presenter->swapchain, NULL, NULL, NULL, NULL, 0);
     presenter->frame_stats.presented++;
 
     IDirect3DDevice9_Release(device);




More information about the wine-cvs mailing list