[vlc-commits] opengl: keep a reference to vlc_gl_api

Romain Vimont git at videolan.org
Mon Jun 15 17:39:12 CEST 2020


vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Thu Jun  4 11:52:18 2020 +0200| [f06d2a823f5e7cc23ea0a167a18b69717257469d] | committer: Alexandre Janniaux

opengl: keep a reference to vlc_gl_api

For convenience, use a local variable to reference the vlc_gl_api.

Signed-off-by: Alexandre Janniaux <ajanni at videolabs.io>

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

 modules/video_output/opengl/vout_helper.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 070b6c2c7e..291a916695 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -111,7 +111,8 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
     if (ret != VLC_SUCCESS)
         goto free_vgl;
 
-    const opengl_vtable_t *vt = &vgl->api.vt;
+    const struct vlc_gl_api *api = &vgl->api;
+    const opengl_vtable_t *vt = &api->vt;
 
 #if !defined(USE_OPENGL_ES2)
     const unsigned char *ogl_version = vt->GetString(GL_VERSION);
@@ -132,7 +133,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
         (GLint)fmt->i_height > max_tex_size)
         ResizeFormatToGLMaxTexSize(fmt, max_tex_size);
 
-    vgl->interop = vlc_gl_interop_New(gl, &vgl->api, context, fmt, false);
+    vgl->interop = vlc_gl_interop_New(gl, api, context, fmt, false);
     if (!vgl->interop)
     {
         msg_Err(gl, "Could not create interop");
@@ -146,7 +147,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
         goto delete_interop;
     }
 
-    vgl->renderer = vlc_gl_renderer_New(gl, &vgl->api, vgl->sampler);
+    vgl->renderer = vlc_gl_renderer_New(gl, api, vgl->sampler);
     if (!vgl->renderer)
     {
         msg_Warn(gl, "Could not create renderer for %4.4s",
@@ -156,7 +157,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
 
     GL_ASSERT_NOERROR(vt);
 
-    vgl->sub_interop = vlc_gl_interop_New(gl, &vgl->api, NULL, fmt, true);
+    vgl->sub_interop = vlc_gl_interop_New(gl, api, NULL, fmt, true);
     if (!vgl->sub_interop)
     {
         msg_Err(gl, "Could not create sub interop");
@@ -164,7 +165,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
     }
 
     vgl->sub_renderer =
-        vlc_gl_sub_renderer_New(gl, &vgl->api, vgl->sub_interop);
+        vlc_gl_sub_renderer_New(gl, api, vgl->sub_interop);
     if (!vgl->sub_renderer)
     {
         msg_Err(gl, "Could not create sub renderer");



More information about the vlc-commits mailing list