[vlc-commits] vout/macosx: add missing locks/unlocks

Thomas Guillem git at videolan.org
Tue Jan 17 15:38:05 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jan 17 15:37:38 2017 +0100| [48a528381c8ed97267d009606d831099dbdfb041] | committer: Thomas Guillem

vout/macosx: add missing locks/unlocks

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

 modules/video_output/macosx.m | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index e3fc9ac..132f5b8 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -325,7 +325,11 @@ void Close (vlc_object_t *this)
                                    waitUntilDone:NO];
 
         if (sys->vgl != NULL)
+        {
+            vlc_gl_MakeCurrent(sys->gl);
             vout_display_opengl_Delete (sys->vgl);
+            vlc_gl_ReleaseCurrent(sys->gl);
+        }
 
         if (sys->gl != NULL)
             vlc_object_release(sys->gl);
@@ -353,7 +357,11 @@ static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
     vout_display_sys_t *sys = vd->sys;
 
     if (!sys->pool)
+    {
+        vlc_gl_MakeCurrent(sys->gl);
         sys->pool = vout_display_opengl_GetPool (sys->vgl, requested_count);
+        vlc_gl_ReleaseCurrent(sys->gl);
+    }
     assert(sys->pool);
     return sys->pool;
 }
@@ -363,14 +371,18 @@ static void PictureRender (vout_display_t *vd, picture_t *pic, subpicture_t *sub
 
     vout_display_sys_t *sys = vd->sys;
 
+    vlc_gl_MakeCurrent(sys->gl);
     vout_display_opengl_Prepare (sys->vgl, pic, subpicture);
+    vlc_gl_ReleaseCurrent(sys->gl);
 }
 
 static void PictureDisplay (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture)
 {
     vout_display_sys_t *sys = vd->sys;
     [sys->glView setVoutFlushing:YES];
+    vlc_gl_MakeCurrent(sys->gl);
     vout_display_opengl_Display (sys->vgl, &vd->source);
+    vlc_gl_ReleaseCurrent(sys->gl);
     [sys->glView setVoutFlushing:NO];
     picture_Release (pic);
     sys->has_first_frame = true;



More information about the vlc-commits mailing list