diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-10-20 21:21:24 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-02 19:00:36 +0100 |
commit | 042302fa6561906a340a6f5f8362d0198bfd9402 (patch) | |
tree | 0225ac00a5ef64dd7de6ebf624eeade7b643b80e | |
parent | 93ce083bd87fe4ff8b9f2c0f36ee76fe0cf9aacc (diff) | |
download | mpv-042302fa6561906a340a6f5f8362d0198bfd9402.tar.bz2 mpv-042302fa6561906a340a6f5f8362d0198bfd9402.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.
-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]; } } |