[vlc-devel] [PATCH 7/9] video_output: create an internal function to disable the window

Steve Lhomme robux4 at ycbcr.xyz
Thu Oct 10 16:27:02 CEST 2019


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

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 7b6703199c8..dc6b68ac003 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1734,14 +1734,9 @@ void vout_StopDisplay(vout_thread_t *vout)
     video_format_Clean(&sys->original);
 }
 
-void vout_Stop(vout_thread_t *vout)
+static void VoutDisableWindow(vout_thread_t *vout)
 {
     vout_thread_sys_t *sys = vout->p;
-    assert(!sys->dummy);
-
-    if (sys->display != NULL)
-        vout_StopDisplay(vout);
-
     vlc_mutex_lock(&sys->window_lock);
     if (sys->window_enabled) {
         vout_window_Disable(sys->display_cfg.window);
@@ -1750,6 +1745,17 @@ void vout_Stop(vout_thread_t *vout)
     vlc_mutex_unlock(&sys->window_lock);
 }
 
+void vout_Stop(vout_thread_t *vout)
+{
+    vout_thread_sys_t *sys = vout->p;
+    assert(!sys->dummy);
+
+    if (sys->display != NULL)
+        vout_StopDisplay(vout);
+
+    VoutDisableWindow(vout);
+}
+
 void vout_Close(vout_thread_t *vout)
 {
     assert(vout);
@@ -2002,11 +2008,7 @@ int vout_Request(const vout_configuration_t *cfg, input_thread_t *input)
     {
         msg_Err(vout, "video output display creation failed");
         video_format_Clean(&sys->original);
-
-        vlc_mutex_lock(&sys->window_lock);
-        vout_window_Disable(sys->display_cfg.window);
-        sys->window_enabled = false;
-        vlc_mutex_unlock(&sys->window_lock);
+        VoutDisableWindow(vout);
         return -1;
     }
     if (vlc_clone(&sys->thread, Thread, vout, VLC_THREAD_PRIORITY_OUTPUT)) {
-- 
2.17.1



More information about the vlc-devel mailing list