diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-10-04 19:19:53 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-10-05 09:33:00 +0200 |
commit | 0ec14ec597a02cec8fb0c1aebd392681aba9c60c (patch) | |
tree | f43155236003a37f38c5f4b815bd0e07529e01a6 /video/out/cocoa_common.m | |
parent | c5ebaca31edf8d31f4f735e3afa67dee2e7b34cc (diff) | |
download | mpv-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/out/cocoa_common.m')
-rw-r--r-- | video/out/cocoa_common.m | 10 |
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; } |