[vlc-devel] [PATCH 04/41] vout:win32: use a single boolean to know if the display area was moved or resized
Steve Lhomme
robux4 at ycbcr.xyz
Fri Mar 22 16:13:42 CET 2019
---
modules/video_output/win32/common.c | 12 +++++-------
modules/video_output/win32/events.c | 6 +++---
modules/video_output/win32/events.h | 2 +-
3 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 154b476467..6d15e15e52 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -171,24 +171,22 @@ static void UpdateRectsInternal(vout_display_t *vd, bool is_forced)
}
/* If nothing changed, we can return */
- bool has_moved;
- bool is_resized;
+ bool moved_or_resized;
#if VLC_WINSTORE_APP
- has_moved = false;
- is_resized = rect.right != (sys->sys.rect_display.right - sys->sys.rect_display.left) ||
+ moved_or_resized = rect.right != (sys->sys.rect_display.right - sys->sys.rect_display.left) ||
rect.bottom != (sys->sys.rect_display.bottom - sys->sys.rect_display.top);
sys->sys.rect_display = rect;
#else
if (sys->b_windowless)
{
- has_moved = is_resized = false;
+ moved_or_resized = false;
}
else
- EventThreadUpdateWindowPosition(sys->event, &has_moved, &is_resized,
+ EventThreadUpdateWindowPosition(sys->event, &moved_or_resized,
point.x, point.y,
rect.right, rect.bottom);
#endif
- if (!is_forced && !has_moved && !is_resized)
+ if (!is_forced && !moved_or_resized)
return;
/* Update the window position and size */
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index 2a70ca2917..f51e137086 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -414,12 +414,12 @@ int EventThreadGetWindowStyle( event_thread_t *p_event )
}
void EventThreadUpdateWindowPosition( event_thread_t *p_event,
- bool *pb_moved, bool *pb_resized,
+ bool *pb_moved_or_resized,
int x, int y, unsigned w, unsigned h )
{
vlc_mutex_lock( &p_event->lock );
- *pb_moved = x != p_event->x || y != p_event->y;
- *pb_resized = w != p_event->width || h != p_event->height;
+ *pb_moved_or_resized = x != p_event->x || y != p_event->y ||
+ w != p_event->width || h != p_event->height;
p_event->x = x;
p_event->y = y;
diff --git a/modules/video_output/win32/events.h b/modules/video_output/win32/events.h
index 26c51a8691..859c712ff4 100644
--- a/modules/video_output/win32/events.h
+++ b/modules/video_output/win32/events.h
@@ -52,7 +52,7 @@ void EventThreadStop( event_thread_t * );
void EventThreadUpdateTitle( event_thread_t *, const char *psz_fallback );
int EventThreadGetWindowStyle( event_thread_t * );
-void EventThreadUpdateWindowPosition( event_thread_t *, bool *pb_moved, bool *pb_resized,
+void EventThreadUpdateWindowPosition( event_thread_t *, bool *pb_moved_or_resized,
int x, int y, unsigned w, unsigned h );
void EventThreadUpdateSourceAndPlace( event_thread_t *p_event,
const video_format_t *p_source,
--
2.17.1
More information about the vlc-devel
mailing list