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.
This commit is contained in:
Stefano Pigozzi 2013-10-20 21:21:24 +02:00
parent afa9e50587
commit 3b156caf78
1 changed files with 6 additions and 6 deletions

View File

@ -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];
}
}