[vlc-devel] [PATCH 2/2] vout: don't drop window size when there is no display plugins yet
Thomas Guillem
thomas at gllm.fr
Wed Mar 25 15:32:11 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 | 5 +++++
src/video_output/vout_internal.h | 5 +++++
src/video_output/vout_wrapper.c | 2 +-
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 373c09f1dc..38b73d9acd 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->display_width = width;
+ sys->display_height = height;
+
if (sys->display != NULL)
vout_display_SetSize(sys->display, width, height);
vlc_mutex_unlock(&sys->display_lock);
@@ -1935,6 +1939,7 @@ vout_thread_t *vout_Create(vlc_object_t *object)
/* Display */
sys->display = NULL;
+ sys->display_width = sys->display_height = 0;
vlc_mutex_init(&sys->display_lock);
/* Window */
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index fdc92bfa45..626db169b7 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -178,6 +178,11 @@ struct vout_thread_sys_t
vout_display_t *display;
vlc_mutex_t display_lock;
+ /* Protected by display_lock, size that will be used as the default display
+ * size when creating a new vd plugin. */
+ unsigned display_width;
+ unsigned display_height;
+
picture_pool_t *private_pool;
picture_pool_t *display_pool;
picture_fifo_t *decoder_fifo;
diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c
index f92da8cfab..1a0a34aeca 100644
--- a/src/video_output/vout_wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -74,7 +74,7 @@ vout_display_t *vout_OpenWrapper(vout_thread_t *vout,
modlist = "splitter,none";
vd = vout_display_New(VLC_OBJECT(vout), &sys->original, vctx, cfg,
- 0, 0,
+ sys->display_width, sys->display_height,
modlist, &owner);
free(modlistbuf);
--
2.20.1
More information about the vlc-devel
mailing list