[vlc-commits] direct3d9: use the source visible area directly

Steve Lhomme git at videolan.org
Mon Apr 1 12:03:38 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Mar 22 13:50:49 2019 +0100| [1516ab3635586d5369fad1d0e610b1b7d8ddd5b0] | committer: Steve Lhomme

direct3d9: use the source visible area directly

Instead of using rect_src_clipped.

Incidentally we setup the vertices to match exactly the size that was copied
rather than the actual size which may use uninitialized pixels.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1516ab3635586d5369fad1d0e610b1b7d8ddd5b0
---

 modules/video_output/win32/direct3d9.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 04d3114d06..40f29d682f 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -453,7 +453,12 @@ static int Direct3D9ImportPicture(vout_display_t *vd,
 
     /* Copy picture surface into texture surface
      * color space conversion happen here */
-    RECT copy_rect = sys->sys.rect_src_clipped;
+    RECT copy_rect = {
+        .left   = vd->source.i_x_offset,
+        .right  = vd->source.i_x_offset + vd->source.i_visible_width,
+        .top    = vd->source.i_y_offset,
+        .bottom = vd->source.i_y_offset + vd->source.i_visible_height,
+    };
     // On nVidia & AMD, StretchRect will fail if the visible size isn't even.
     // When copying the entire buffer, the margin end up being blended in the actual picture
     // on nVidia (regardless of even/odd dimensions)
@@ -472,7 +477,8 @@ static int Direct3D9ImportPicture(vout_display_t *vd,
 
     /* */
     region->texture = sys->sceneTexture;
-    Direct3D9SetupVertices(region->vertex, &vd->sys->sys.rect_src, &vd->sys->sys.rect_src_clipped,
+    Direct3D9SetupVertices(region->vertex, &vd->sys->sys.rect_src,
+                           &copy_rect,
                            &vd->sys->sys.rect_dest, 255, vd->source.orientation);
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list