[vlc-devel] [PATCH 2/8] opengl: refactor, use intermediate variable

Thomas Guillem thomas at gllm.fr
Wed May 23 09:19:22 CEST 2018


---
 src/video_output/opengl.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/video_output/opengl.c b/src/video_output/opengl.c
index f5f19085d2..481df220cb 100644
--- a/src/video_output/opengl.c
+++ b/src/video_output/opengl.c
@@ -70,11 +70,12 @@ vlc_gl_t *vlc_gl_Create(struct vout_window_t *wnd, unsigned flags,
     if (unlikely(glpriv == NULL))
         return NULL;
 
-    glpriv->gl.surface = wnd;
-    glpriv->gl.module = module_need(&glpriv->gl, type, name, true);
-    if (glpriv->gl.module == NULL)
+    vlc_gl_t *gl = &glpriv->gl;
+    gl->surface = wnd;
+    gl->module = module_need(gl, type, name, true);
+    if (gl->module == NULL)
     {
-        vlc_object_release(&glpriv->gl);
+        vlc_object_release(gl);
         return NULL;
     }
     atomic_init(&glpriv->ref_count, 1);
-- 
2.17.0



More information about the vlc-devel mailing list