mirror of https://github.com/mpv-player/mpv
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
afa9e50587
commit
3b156caf78
|
@ -438,16 +438,16 @@ void vo_cocoa_set_current_context(struct vo *vo, bool current)
|
||||||
{
|
{
|
||||||
struct vo_cocoa_state *s = vo->cocoa;
|
struct vo_cocoa_state *s = vo->cocoa;
|
||||||
|
|
||||||
if (s->inside_sync_section) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (current) {
|
if (current) {
|
||||||
[s->lock lock];
|
if (!s->inside_sync_section)
|
||||||
|
[s->lock lock];
|
||||||
|
|
||||||
[s->gl_ctx makeCurrentContext];
|
[s->gl_ctx makeCurrentContext];
|
||||||
} else {
|
} else {
|
||||||
[NSOpenGLContext clearCurrentContext];
|
[NSOpenGLContext clearCurrentContext];
|
||||||
[s->lock unlock];
|
|
||||||
|
if (!s->inside_sync_section)
|
||||||
|
[s->lock unlock];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue