vout/macosx: Ensure context exists when calling vout_display_opengl_New
authorMarvin Scholz <epirat07@gmail.com>
Wed, 28 Dec 2016 16:45:25 +0000 (17:45 +0100)
committerThomas Guillem <thomas@gllm.fr>
Thu, 29 Dec 2016 12:48:24 +0000 (13:48 +0100)
vout_display_opengl_New seems to require a valid context, therefore we
need to vlc_gl_MakeCurrent before calling it and release it again
afterwards.

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
modules/video_output/macosx.m

index 0329741..e3fc9ac 100644 (file)
@@ -267,8 +267,10 @@ static int Open (vlc_object_t *this)
 
         const vlc_fourcc_t *subpicture_chromas;
 
+        vlc_gl_MakeCurrent(sys->gl);
         sys->vgl = vout_display_opengl_New (&vd->fmt, &subpicture_chromas, sys->gl,
                                             &vd->cfg->viewpoint);
+        vlc_gl_ReleaseCurrent(sys->gl);
         if (!sys->vgl) {
             msg_Err(vd, "Error while initializing opengl display.");
             goto error;