[vlc-commits] opengl: initialize api_type

Romain Vimont git at videolan.org
Thu Mar 4 18:48:40 UTC 2021


vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Thu Mar  4 14:30:18 2021 +0100| [bf0160ad6d73dd65d38617934840e0d05c93b540] | committer: Alexandre Janniaux

opengl: initialize api_type

Contrary to vlc_gl_Create(), vlc_gl_CreateOffscreen() did not initialize
gl->api_type, so it was always implicitly set to VLC_OPENGL, never
VLC_OPENGL_ES2.

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

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

 src/video_output/opengl.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/video_output/opengl.c b/src/video_output/opengl.c
index cf0db8567f..778bd80a6e 100644
--- a/src/video_output/opengl.c
+++ b/src/video_output/opengl.c
@@ -105,13 +105,17 @@ vlc_gl_t *vlc_gl_CreateOffscreen(vlc_object_t *parent,
     struct vlc_gl_priv_t *glpriv;
     const char *type;
 
+    enum vlc_gl_api_type api_type;
+
     switch (flags /*& VLC_OPENGL_API_MASK*/)
     {
         case VLC_OPENGL:
             type = "opengl offscreen";
+            api_type = VLC_OPENGL;
             break;
         case VLC_OPENGL_ES2:
             type = "opengl es2 offscreen";
+            api_type = VLC_OPENGL_ES2;
             break;
         default:
             return NULL;
@@ -123,6 +127,8 @@ vlc_gl_t *vlc_gl_CreateOffscreen(vlc_object_t *parent,
 
     vlc_gl_t *gl = &glpriv->gl;
 
+    gl->api_type = api_type;
+
     gl->offscreen_chroma_out = VLC_CODEC_UNKNOWN;
     gl->offscreen_vflip = false;
     gl->offscreen_vctx_out = NULL;



More information about the vlc-commits mailing list