[vlc-commits] direct3d: Don't copy from an odd offset

Hugo Beauzée-Luyssen git at videolan.org
Thu Jun 1 18:05:04 CEST 2017


vlc/vlc-2.2 | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Jun  1 11:08:58 2017 +0200| [36e8122e68a45f66b9dfe5fbea924be0ca291afa] | committer: Hugo Beauzée-Luyssen

direct3d: Don't copy from an odd offset

This can (and often will) make StretchRect fail
(cherry-picked from commit 4a4d32f251cda32a2aee0fff9a49563da8c6f0cb)

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=36e8122e68a45f66b9dfe5fbea924be0ca291afa
---

 modules/video_output/msw/direct3d.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
index 98e9eef368..98b90acf1c 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -1468,7 +1468,9 @@ static int Direct3DImportPicture(vout_display_t *vd,
     // When copying the entire buffer, the margin end up being blended in the actual picture
     // on nVidia (regardless of even/odd dimensions)
     if ( copy_rect.right & 1 ) copy_rect.right++;
+    if ( copy_rect.left & 1 ) copy_rect.left--;
     if ( copy_rect.bottom & 1 ) copy_rect.bottom++;
+    if ( copy_rect.top & 1 ) copy_rect.top--;
     hr = IDirect3DDevice9_StretchRect(sys->d3ddev, source, &copy_rect, destination,
                                       &copy_rect, D3DTEXF_NONE);
     IDirect3DSurface9_Release(destination);



More information about the vlc-commits mailing list