[vlc-commits] vout: resize display synchronously

Rémi Denis-Courmont git at videolan.org
Fri Jun 14 05:31:27 CEST 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jun 12 20:33:34 2019 +0300| [c9d6d95f291b1e2c0e4f374f87790af091282c1e] | committer: Rémi Denis-Courmont

vout: resize display synchronously

Like the splitter already does, this ensures that we do not queue a
large number of events via vout control upon drag-and-drop of the window.

This also prevents acknowledging the window resize before the resize is
actually handled (refs #20572).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c9d6d95f291b1e2c0e4f374f87790af091282c1e
---

 src/video_output/control.h      |  7 -------
 src/video_output/video_output.c | 21 +++++++--------------
 2 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/src/video_output/control.h b/src/video_output/control.h
index 5c4448a6c0..acac368d2d 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -31,7 +31,6 @@ enum {
     VOUT_CONTROL_CHANGE_INTERLACE,      /* boolean */
 
     VOUT_CONTROL_MOUSE_STATE,           /* vlc_mouse_t */
-    VOUT_CONTROL_DISPLAY_SIZE,          /* window */
 
     VOUT_CONTROL_VIEWPOINT,             /* viewpoint */
 };
@@ -43,12 +42,6 @@ typedef struct {
         bool    boolean;
         char    *string;
         struct {
-            unsigned x;
-            unsigned y;
-            unsigned width;
-            unsigned height;
-        } window;
-        struct {
             int channel;
             float value;
         } spu_rate;
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index da8c5e2333..0fd6790b44 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -413,16 +413,15 @@ void vout_ChangeWindowState(vout_thread_t *vout, unsigned st)
 void vout_ChangeDisplaySize(vout_thread_t *vout,
                             unsigned width, unsigned height)
 {
+    vout_thread_sys_t *sys = vout->p;
+
     assert(!vout->p->dummy);
-    /* DO NOT call this outside the vout window callbacks */
-    vout_control_cmd_t cmd;
 
-    vout_control_cmd_Init(&cmd, VOUT_CONTROL_DISPLAY_SIZE);
-    cmd.window.x      = 0;
-    cmd.window.y      = 0;
-    cmd.window.width  = width;
-    cmd.window.height = height;
-    vout_control_Push(&vout->p->control, &cmd);
+    /* DO NOT call this outside the vout window callbacks */
+    vlc_mutex_lock(&sys->display_lock);
+    if (sys->display != NULL)
+        vout_display_SetSize(sys->display, width, height);
+    vlc_mutex_unlock(&sys->display_lock);
 }
 
 void vout_ChangeDisplayFilled(vout_thread_t *vout, bool is_filled)
@@ -1576,12 +1575,6 @@ static void ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
     case VOUT_CONTROL_MOUSE_STATE:
         ThreadProcessMouseState(vout, &cmd.mouse);
         break;
-    case VOUT_CONTROL_DISPLAY_SIZE:
-        vlc_mutex_lock(&vout->p->display_lock);
-        vout_display_SetSize(vout->p->display,
-                             cmd.window.width, cmd.window.height);
-        vlc_mutex_unlock(&vout->p->display_lock);
-        break;
     case VOUT_CONTROL_VIEWPOINT:
         vlc_mutex_lock(&vout->p->display_lock);
         vout_SetDisplayViewpoint(vout->p->display, &cmd.viewpoint);



More information about the vlc-commits mailing list