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

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


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

direct3d: Don't copy from an odd offset

This can (and often will) make StretchRect fail

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

 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