mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 12:02:23 +02:00
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:
parent
93ce083bd8
commit
042302fa65
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user