Skip to content

Commit

Permalink
cocoa_common: avoid locking calls when not needed
Browse files Browse the repository at this point in the history
cocoa_common contains some locking calls to support video outputs that support
live resizing (at this moment only vo=opengl).

These should not be used unless the VO declares it is multithreaded by
registering the resize_redraw callback used for live resizing.

Fixes #200
  • Loading branch information
pigoz authored and wm4 committed Aug 23, 2013
1 parent 69d46b1 commit 815ad3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions video/out/cocoa_common.m
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ int vo_cocoa_check_events(struct vo *vo)

void vo_cocoa_fullscreen(struct vo *vo)
{
if (![NSThread isMainThread]) {
if (![NSThread isMainThread] && resize_callback_registered(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);
Expand All @@ -535,7 +535,7 @@ void vo_cocoa_fullscreen(struct vo *vo)
waitUntilDone:YES];


if (![NSThread isMainThread]) {
if (![NSThread isMainThread] && resize_callback_registered(vo)) {
// Now lock again!
vo_cocoa_set_current_context(vo, true);
}
Expand Down

0 comments on commit 815ad3f

Please sign in to comment.