[vlc-devel] [PATCH 10/41] vout:win32: clean the window dimension check
Steve Lhomme
robux4 at ycbcr.xyz
Fri Mar 22 16:13:48 CET 2019
---
modules/video_output/win32/common.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 03112c2257..56e18b7d29 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -145,7 +145,7 @@ static void UpdateRectsInternal(vout_display_t *vd, bool is_forced)
#define rect_dest sys->area.rect_dest
#define rect_dest_clipped sys->area.rect_dest_clipped
- RECT rect;
+ RECT new_display_rect;
POINT window_pos = { 0 };
/* */
@@ -154,23 +154,23 @@ static void UpdateRectsInternal(vout_display_t *vd, bool is_forced)
/* Retrieve the window size */
if (sys->b_windowless)
{
- rect.left = 0;
- rect.top = 0;
- rect.right = vd->source.i_visible_width;
- rect.bottom = vd->source.i_visible_height;
+ new_display_rect.left = 0;
+ new_display_rect.top = 0;
+ new_display_rect.right = vd->source.i_visible_width;
+ new_display_rect.bottom = vd->source.i_visible_height;
}
else
{
- if (!sys->pf_GetRect(sys, &rect))
+ if (!sys->pf_GetRect(sys, &new_display_rect))
return;
}
/* If nothing changed, we can return */
bool moved_or_resized;
#if VLC_WINSTORE_APP
- moved_or_resized = rect.right != RECTWidth(sys->sys.rect_display) ||
- rect.bottom != RECTHeight(sys->sys.rect_display);
- sys->sys.rect_display = rect;
+ moved_or_resized = RECTWidth(new_display_rect) != RECTWidth(sys->sys.rect_display) ||
+ RECTHeight(new_display_rect) != RECTHeight(sys->sys.rect_display);
+ sys->sys.rect_display = new_display_rect;
#else
if (sys->b_windowless)
{
@@ -183,7 +183,7 @@ static void UpdateRectsInternal(vout_display_t *vd, bool is_forced)
moved_or_resized = EventThreadUpdateWindowPosition(sys->event,
&window_pos,
- rect.right, rect.bottom);
+ new_display_rect.right, new_display_rect.bottom);
}
#endif
if (!is_forced && !moved_or_resized)
@@ -191,8 +191,8 @@ static void UpdateRectsInternal(vout_display_t *vd, bool is_forced)
/* Update the window position and size */
vout_display_cfg_t place_cfg = *cfg;
- place_cfg.display.width = rect.right;
- place_cfg.display.height = rect.bottom;
+ place_cfg.display.width = RECTWidth(new_display_rect);
+ place_cfg.display.height = RECTHeight(new_display_rect);
#if (defined(MODULE_NAME_IS_glwin32))
/* Reverse vertical alignment as the GL tex are Y inverted */
--
2.17.1
More information about the vlc-devel
mailing list