diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-10-20 21:21:24 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-10-20 21:25:55 +0200 |
commit | 3b156caf784bb404682bb20415f8aaabc9921256 (patch) | |
tree | a1544b066d2925a1f2914b922b21893d12ea357d /video/out/cocoa_common.m | |
parent | afa9e50587db1e85a441549455ee0252fd8434ba (diff) | |
download | mpv-3b156caf784bb404682bb20415f8aaabc9921256.tar.bz2 mpv-3b156caf784bb404682bb20415f8aaabc9921256.tar.xz |
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.
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r-- | video/out/cocoa_common.m | 12 |
1 files changed, 6 insertions, 6 deletions
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]; } } |