diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-05-13 23:19:44 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-05-13 23:41:03 +0200 |
commit | 4878be02ada77abdce716c39a1d6e1711a21f969 (patch) | |
tree | c77f2de4419c49d4ec62daad025d18a7c3eae58f /video/out/cocoa_common.m | |
parent | 4ce808cc2c648d3358ed0088ac3b0311c5ff37d5 (diff) | |
download | mpv-4878be02ada77abdce716c39a1d6e1711a21f969.tar.bz2 mpv-4878be02ada77abdce716c39a1d6e1711a21f969.tar.xz |
cocoa_common: remove pointless locking when using -fs
When using --fs `vo_cocoa_fullscreen` was called from the primary thread. This
occurred inside `vo_cocoa_config_window` which is scheduled for excution on the
primary thread with libdispatch).
All of this caused spam from NSRecursiveLock in standard output.
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r-- | video/out/cocoa_common.m | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 4a6cfb6a93..988b03e38f 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -635,17 +635,22 @@ int vo_cocoa_check_events(struct vo *vo) void vo_cocoa_fullscreen(struct vo *vo) { - // This is the secondary thread, unlock since we are going to invoke a - // method synchronously on the GUI thread using Cocoa. - vo_cocoa_set_current_context(vo, false); + if (![NSThread isMainThread]) { + // This is the secondary thread, unlock since we are going to invoke a + // method synchronously on the GUI thread using Cocoa. + vo_cocoa_set_current_context(vo, false); + } struct vo_cocoa_state *s = vo->cocoa; [s->window performSelectorOnMainThread:@selector(fullscreen) withObject:nil waitUntilDone:YES]; - // Now lock again! - vo_cocoa_set_current_context(vo, true); + + if (![NSThread isMainThread]) { + // Now lock again! + vo_cocoa_set_current_context(vo, true); + } } int vo_cocoa_swap_interval(int enabled) |