[vlc-devel] [PATCH 7/7] vout: don't drop window size when there is no display plugins yet

Thomas Guillem thomas at gllm.fr
Thu Mar 26 16:33:53 CET 2020


This fixes the window size that was ignored when the size was updated from the
open callback of the window plugin.

Fixes #22674
---
 src/video_output/video_output.c  | 9 +++++++++
 src/video_output/vout_internal.h | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 0f4387d684..ed6bb86103 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -425,6 +425,10 @@ void vout_ChangeDisplaySize(vout_thread_t *vout,
 
     /* DO NOT call this outside the vout window callbacks */
     vlc_mutex_lock(&sys->display_lock);
+
+    sys->window_width = width;
+    sys->window_height = height;
+
     if (sys->display != NULL)
         vout_display_SetSize(sys->display, width, height);
     vlc_mutex_unlock(&sys->display_lock);
@@ -1605,6 +1609,10 @@ static int vout_Start(vout_thread_t *vout, vlc_video_context *vctx, const vout_c
     vlc_mutex_lock(&sys->display_lock);
     vlc_mutex_unlock(&sys->window_lock);
 
+    /* Setup the window size, protected by the display_lock */
+    dcfg.window.width = sys->window_width;
+    dcfg.window.height = sys->window_height;
+
     sys->display = vout_OpenWrapper(vout, sys->splitter_name, &dcfg,
                                     sys->window, vctx);
     if (sys->display == NULL) {
@@ -1939,6 +1947,7 @@ vout_thread_t *vout_Create(vlc_object_t *object)
     vlc_mutex_init(&sys->display_lock);
 
     /* Window */
+    sys->window_width = sys->window_height = 0;
     sys->window = vout_display_window_New(vout);
     if (sys->window == NULL) {
         if (sys->spu)
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index 4d8a63784e..37656f9a60 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -171,6 +171,8 @@ struct vout_thread_sys_t
     /* Video output window */
     vout_window_t  *window;
     bool            window_enabled;
+    unsigned        window_width; /* protected by display_lock */
+    unsigned        window_height; /* protected by display_lock */
     vlc_mutex_t     window_lock;
     vlc_decoder_device *dec_device;
 
-- 
2.20.1



More information about the vlc-devel mailing list