[vlc-devel] [PATCH] opengl: initialize api_type

Alexandre Janniaux ajanni at videolabs.io
Thu Mar 4 18:49:16 UTC 2021


Merged, thanks !

--
Alexandre Janniaux
Videolabs

On Thu, Mar 04, 2021 at 02:30:18PM +0100, Romain Vimont wrote:
> 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.
> ---
>  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;
> --
> 2.30.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list