[vlc-devel] [PATCH 2/9] video_output: simplify the locking of the display in vout_UpdateWindowSizeLocked

Steve Lhomme robux4 at ycbcr.xyz
Thu Oct 10 16:26:57 CEST 2019


---
 src/video_output/video_output.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index a5046913867..874d51f8e08 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -201,15 +201,17 @@ static void vout_UpdateWindowSizeLocked(vout_thread_t *vout)
 
     vlc_mutex_assert(&sys->window_lock);
 
+    bool new_size = false;
     vlc_mutex_lock(&sys->display_lock);
     if (sys->display != NULL) {
+        new_size = true;
         vout_SizeWindow(vout, &width, &height);
-        vlc_mutex_unlock(&sys->display_lock);
-
         msg_Dbg(vout, "requested window size: %ux%u", width, height);
+    }
+    vlc_mutex_unlock(&sys->display_lock);
+
+    if (new_size)
         vout_window_SetSize(vout->p->display_cfg.window, width, height);
-    } else
-        vlc_mutex_unlock(&sys->display_lock);
 }
 
 /* */
-- 
2.17.1



More information about the vlc-devel mailing list