[vlc-devel] [PATCH 24/41] vout:win32: simplify the rect_src_clipped computing
Steve Lhomme
robux4 at ycbcr.xyz
Fri Mar 22 16:14:02 CET 2019
Since rect_dest_clipped = rect_dest it's always the source visible area.
---
modules/video_output/win32/common.c | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 5a32e57d42..726e2b51d8 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -249,20 +249,10 @@ static void UpdateRectsInternal(vout_display_t *vd, vout_display_sys_win32_t *sy
rect_src.bottom = sys->area.pf_GetPictureHeight(vd);
/* Clip the source image */
- rect_src_clipped.left = source->i_x_offset +
- (rect_dest.left - rect_dest.left) *
- source->i_visible_width / RECTWidth(rect_dest);
- rect_src_clipped.right = source->i_x_offset +
- source->i_visible_width -
- (rect_dest.right - rect_dest.right) *
- source->i_visible_width / RECTWidth(rect_dest);
- rect_src_clipped.top = source->i_y_offset +
- (rect_dest.top - rect_dest.top) *
- source->i_visible_height / RECTHeight(rect_dest);
- rect_src_clipped.bottom = source->i_y_offset +
- source->i_visible_height -
- (rect_dest.bottom - rect_dest.bottom) *
- source->i_visible_height / RECTHeight(rect_dest);
+ rect_src_clipped.left = source->i_x_offset;
+ rect_src_clipped.right = source->i_x_offset + source->i_visible_width;
+ rect_src_clipped.top = source->i_y_offset;
+ rect_src_clipped.bottom = source->i_y_offset + source->i_visible_height;
#ifndef NDEBUG
msg_Dbg(vd, "DirectXUpdateRects source"
@@ -273,10 +263,6 @@ static void UpdateRectsInternal(vout_display_t *vd, vout_display_sys_win32_t *sy
" coords: %li,%li,%li,%li",
rect_src.left, rect_src.top,
rect_src.right, rect_src.bottom);
- msg_Dbg(vd, "DirectXUpdateRects image_src_clipped"
- " coords: %li,%li,%li,%li",
- rect_src_clipped.left, rect_src_clipped.top,
- rect_src_clipped.right, rect_src_clipped.bottom);
msg_Dbg(vd, "DirectXUpdateRects image_dst"
" coords: %li,%li,%li,%li",
rect_dest.left, rect_dest.top,
--
2.17.1
More information about the vlc-devel
mailing list