[vlc-commits] vout: macos: lock the OpenGL context before applying changes

Thomas Guillem git at videolan.org
Fri Sep 8 13:46:19 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Sep  8 10:11:22 2017 +0200| [3616a239c651f28db8cf6877359ba27764ab22b8] | committer: Thomas Guillem

vout: macos: lock the OpenGL context before applying changes

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

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

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index a04e12c7df..a300a21493 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -409,6 +409,8 @@ static int Control (vout_display_t *vd, int query, va_list ap)
                     sys->place = place;
                 }
 
+                if (vlc_gl_MakeCurrent (sys->gl) != VLC_SUCCESS)
+                    return VLC_EGENERIC;
                 vout_display_opengl_SetWindowAspectRatio(sys->vgl, (float)place.width / place.height);
 
                 /* For resize, we call glViewport in reshape and not here.
@@ -416,6 +418,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
                 if (query != VOUT_DISPLAY_CHANGE_DISPLAY_SIZE)
                     // x / y are top left corner, but we need the lower left one
                     glViewport (place.x, cfg_tmp.display.height - (place.y + place.height), place.width, place.height);
+                vlc_gl_ReleaseCurrent (sys->gl);
 
                 return VLC_SUCCESS;
             }



More information about the vlc-commits mailing list