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.
This commit is contained in:
Stefano Pigozzi 2013-05-13 23:19:44 +02:00
parent 4ce808cc2c
commit 4878be02ad
1 changed files with 10 additions and 5 deletions

View File

@ -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)