[vlc-commits] vout/ios2: add missing vlc_gl_MakeCurrent()/vlc_gl_ReleaseCurrent()

Thomas Guillem git at videolan.org
Thu Dec 29 14:36:15 CET 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Dec 29 14:05:06 2016 +0100| [0a6a1f6dbec0e63b58d052e28ca0a5eadd56dbec] | committer: Jean-Baptiste Kempf

vout/ios2: add missing vlc_gl_MakeCurrent()/vlc_gl_ReleaseCurrent()

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/video_output/ios2.m | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/modules/video_output/ios2.m b/modules/video_output/ios2.m
index 39dcb8e..14463c7 100644
--- a/modules/video_output/ios2.m
+++ b/modules/video_output/ios2.m
@@ -267,8 +267,10 @@ static int Open(vlc_object_t *this)
             sys->gl->getProcAddress = OurGetProcAddress;
             sys->gl->sys = sys;
 
+            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)
                 goto bailout;
         } else {
@@ -349,7 +351,11 @@ void Close (vlc_object_t *this)
                 msg_Dbg(this, "deleting display");
 
                 if (likely([sys->glESView isAppActive]))
+                {
+                    vlc_gl_MakeCurrent(sys->gl);
                     vout_display_opengl_Delete(sys->vgl);
+                    vlc_gl_ReleaseCurrent(sys->gl);
+                }
             }
             vlc_object_release(sys->gl);
         }
@@ -453,7 +459,9 @@ static void PictureDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *sub
     sys->has_first_frame = true;
     @synchronized (sys->glESView) {
         if (likely([sys->glESView isAppActive])) {
+            vlc_gl_MakeCurrent(sys->gl);
             vout_display_opengl_Display(sys->vgl, &vd->source);
+            vlc_gl_ReleaseCurrent(sys->gl);
         }
     }
 
@@ -467,7 +475,11 @@ static void PictureRender(vout_display_t *vd, picture_t *pic, subpicture_t *subp
 {
     vout_display_sys_t *sys = vd->sys;
     if (likely([sys->glESView isAppActive]))
+    {
+        vlc_gl_MakeCurrent(sys->gl);
         vout_display_opengl_Prepare(sys->vgl, pic, subpicture);
+        vlc_gl_ReleaseCurrent(sys->gl);
+    }
 }
 
 static picture_pool_t *PicturePool(vout_display_t *vd, unsigned requested_count)
@@ -475,7 +487,11 @@ static picture_pool_t *PicturePool(vout_display_t *vd, unsigned requested_count)
     vout_display_sys_t *sys = vd->sys;
 
     if (!sys->picturePool)
+    {
+        vlc_gl_MakeCurrent(sys->gl);
         sys->picturePool = vout_display_opengl_GetPool(sys->vgl, requested_count);
+        vlc_gl_ReleaseCurrent(sys->gl);
+    }
     assert(sys->picturePool);
     return sys->picturePool;
 }



More information about the vlc-commits mailing list