summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-10-04 19:19:53 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2014-10-05 09:33:00 +0200
commit0ec14ec597a02cec8fb0c1aebd392681aba9c60c (patch)
treef43155236003a37f38c5f4b815bd0e07529e01a6 /video
parentc5ebaca31edf8d31f4f735e3afa67dee2e7b34cc (diff)
downloadmpv-0ec14ec597a02cec8fb0c1aebd392681aba9c60c.tar.bz2
mpv-0ec14ec597a02cec8fb0c1aebd392681aba9c60c.tar.xz
cocoa: simplify the config code and run it on the main thread
This could be dangerous because we initialize the window asynchronously and return immediately from config, but since the OpenGL context is already created, this seems to work correctly and doesn't cause weird deadlock cases.
Diffstat (limited to 'video')
-rw-r--r--video/out/cocoa_common.m10
1 files changed, 1 insertions, 9 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index eac930125a..7570f51637 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -366,9 +366,7 @@ void vo_cocoa_release_nsgl_ctx(struct vo *vo)
int vo_cocoa_config_window(struct vo *vo, uint32_t flags, void *gl_ctx)
{
struct vo_cocoa_state *s = vo->cocoa;
- __block int ctxok = 0;
-
- with_cocoa_lock(vo, ^{
+ with_cocoa_lock_on_main_thread(vo, ^{
struct mp_rect screenrc;
vo_cocoa_update_screen_info(vo, &screenrc);
@@ -394,12 +392,6 @@ int vo_cocoa_config_window(struct vo *vo, uint32_t flags, void *gl_ctx)
cocoa_add_fs_screen_profile_observer(vo);
}
});
-
- if (ctxok < 0)
- return ctxok;
-
- [vo->cocoa->gl_ctx makeCurrentContext];
-
return 0;
}