[vlc-commits] video_output: return NULL earlier if no vout_window_t was created

Steve Lhomme git at videolan.org
Mon Apr 1 12:03:25 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Mar 29 14:27:22 2019 +0100| [ce56a04a4abcc821bbece367fc35d36c1899046a] | committer: Steve Lhomme

video_output: return NULL earlier if no vout_window_t was created

Now it's more obvious reading the code that a vout_thread_t doesn't exist if
there's no associated window.

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

 src/video_output/video_output.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 076ea49557..0ce46d893b 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1778,6 +1778,12 @@ vout_thread_t *vout_Create(vlc_object_t *object)
 
     /* Window */
     sys->display_cfg.window = vout_display_window_New(vout);
+    if (sys->display_cfg.window == NULL) {
+        spu_Destroy(sys->spu);
+        vlc_object_delete(vout);
+        return NULL;
+    }
+
     if (sys->splitter_name != NULL)
         var_Destroy(vout, "window");
     sys->window_active = false;
@@ -1789,12 +1795,6 @@ vout_thread_t *vout_Create(vlc_object_t *object)
     /* */
     atomic_init(&sys->refs, 0);
 
-    if (sys->display_cfg.window == NULL) {
-        spu_Destroy(sys->spu);
-        vlc_object_delete(vout);
-        return NULL;
-    }
-
     if (var_InheritBool(vout, "video-wallpaper"))
         vout_window_SetState(sys->display_cfg.window, VOUT_WINDOW_STATE_BELOW);
     else if (var_InheritBool(vout, "video-on-top"))



More information about the vlc-commits mailing list