[vlc-commits] video_output: split vout_Request to have a function to enable the vout window

Steve Lhomme git at videolan.org
Wed Oct 16 13:50:54 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Oct 10 16:12:37 2019 +0200| [76c625cc77753eff7553d78575decb50df0c6757] | committer: Steve Lhomme

video_output: split vout_Request to have a function to enable the vout window

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

 src/video_output/video_output.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index be31598b3d..44b2fb503d 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1925,7 +1925,7 @@ vout_thread_t *vout_Hold(vout_thread_t *vout)
     return vout;
 }
 
-int vout_Request(const vout_configuration_t *cfg, input_thread_t *input)
+static int vout_EnableWindow(const vout_configuration_t *cfg)
 {
     vout_thread_t *vout = cfg->vout;
     vout_thread_sys_t *sys = vout->p;
@@ -1984,14 +1984,24 @@ int vout_Request(const vout_configuration_t *cfg, input_thread_t *input)
         sys->window_enabled = true;
     } else
         vout_UpdateWindowSizeLocked(vout);
+    vlc_mutex_unlock(&sys->window_lock);
+
+    return 0;
+}
+
+int vout_Request(const vout_configuration_t *cfg, input_thread_t *input)
+{
+    vout_thread_t *vout = cfg->vout;
+    vout_thread_sys_t *sys = vout->p;
+
+    if (vout_EnableWindow(cfg) != 0)
+        return -1;
 
     sys->delay = 0;
     sys->rate = 1.f;
     sys->clock = cfg->clock;
     sys->delay = 0;
 
-    vlc_mutex_unlock(&sys->window_lock);
-
     if (vout_Start(vout, cfg))
     {
         msg_Err(vout, "video output display creation failed");



More information about the vlc-commits mailing list