[vlc-devel] [PATCH 09/41] vout:win32: return whether the window position changed or not

Steve Lhomme robux4 at ycbcr.xyz
Fri Mar 22 16:13:47 CET 2019


Instead of using a point to get the value.
---
 modules/video_output/win32/common.c | 6 +++---
 modules/video_output/win32/events.c | 6 +++---
 modules/video_output/win32/events.h | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 4865a28580..03112c2257 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -181,9 +181,9 @@ static void UpdateRectsInternal(vout_display_t *vd, bool is_forced)
         /* Retrieve the window position */
         ClientToScreen(sys->hwnd, &window_pos);
 
-        EventThreadUpdateWindowPosition(sys->event, &moved_or_resized,
-                                        &window_pos,
-                                        rect.right, rect.bottom);
+        moved_or_resized = EventThreadUpdateWindowPosition(sys->event,
+                                                           &window_pos,
+                                                           rect.right, rect.bottom);
     }
 #endif
     if (!is_forced && !moved_or_resized)
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index 081b4c1450..16dc4d9870 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -413,12 +413,11 @@ int EventThreadGetWindowStyle( event_thread_t *p_event )
     return p_event->i_window_style;
 }
 
-void EventThreadUpdateWindowPosition( event_thread_t *p_event,
-                                      bool *pb_moved_or_resized,
+bool EventThreadUpdateWindowPosition( event_thread_t *p_event,
                                       const POINT *pos, unsigned w, unsigned h )
 {
     vlc_mutex_lock( &p_event->lock );
-    *pb_moved_or_resized   = pos->x != p_event->x || pos->y != p_event->y ||
+    bool moved_or_resized  = pos->x != p_event->x || pos->y != p_event->y ||
                              w != p_event->width || h != p_event->height;
 
     p_event->x      = pos->x;
@@ -426,6 +425,7 @@ void EventThreadUpdateWindowPosition( event_thread_t *p_event,
     p_event->width  = w;
     p_event->height = h;
     vlc_mutex_unlock( &p_event->lock );
+    return moved_or_resized;
 }
 
 void EventThreadUpdateSourceAndPlace( event_thread_t *p_event,
diff --git a/modules/video_output/win32/events.h b/modules/video_output/win32/events.h
index fa399ab922..25b9b3de0e 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_or_resized,
+bool            EventThreadUpdateWindowPosition( event_thread_t *,
                                                  const POINT *window_pos, 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