[vlc-devel] [PATCH 5/9] video_output: separate the error logs and return in vout_Request

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


vout_Stop already clean sys->original, so no need to do it again.
---
 src/video_output/video_output.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 7dad8278db7..7e0df907e19 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1986,7 +1986,8 @@ int vout_Request(const vout_configuration_t *cfg, input_thread_t *input)
 
         if (vout_window_Enable(sys->display_cfg.window, &wcfg)) {
             vlc_mutex_unlock(&sys->window_lock);
-            goto error;
+            video_format_Clean(&sys->original);
+            return -1;
         }
         sys->window_enabled = true;
     } else
@@ -2001,17 +2002,18 @@ int vout_Request(const vout_configuration_t *cfg, input_thread_t *input)
 
     if (vout_Start(vout, cfg))
     {
+        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);
-        goto error;
+        return -1;
     }
     if (vlc_clone(&sys->thread, Thread, vout, VLC_THREAD_PRIORITY_OUTPUT)) {
+        msg_Err(vout, "video output thread creation failed");
         vout_Stop(vout);
-error:
-        msg_Err(vout, "video output creation failed");
-        video_format_Clean(&sys->original);
         return -1;
     }
 
-- 
2.17.1



More information about the vlc-devel mailing list