From 3b156caf784bb404682bb20415f8aaabc9921256 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 20 Oct 2013 21:21:24 +0200 Subject: cocoa: set and clear gl context inside of sync sections The code did not set and unset the current context inside sync sections. I am not sure if this was an actual problem but this is better since the context is linked to a single thread. In my brief tests this seems to avoid garbage to show up in fullscreen. --- video/out/cocoa_common.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'video') diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 1c5c3a5e25..6987d5ca5d 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -438,16 +438,16 @@ void vo_cocoa_set_current_context(struct vo *vo, bool current) { struct vo_cocoa_state *s = vo->cocoa; - if (s->inside_sync_section) { - return; - } - if (current) { - [s->lock lock]; + if (!s->inside_sync_section) + [s->lock lock]; + [s->gl_ctx makeCurrentContext]; } else { [NSOpenGLContext clearCurrentContext]; - [s->lock unlock]; + + if (!s->inside_sync_section) + [s->lock unlock]; } } -- cgit v1.2.3