summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-08-23 12:20:25 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-08-23 13:58:38 +0200
commitfcde6207a197aa31a1c3b7d412814136e9232c66 (patch)
tree36bcfda2122ee53fa142d92f0ef296930a8b378e /video
parentedd36a3afce4ca3778461e61df64f6a79ba94079 (diff)
downloadmpv-fcde6207a197aa31a1c3b7d412814136e9232c66.tar.bz2
mpv-fcde6207a197aa31a1c3b7d412814136e9232c66.tar.xz
cocoa_common: avoid locking calls when not needed
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
Diffstat (limited to 'video')
-rw-r--r--video/out/cocoa_common.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index 7b64619909..6c51584359 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -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);
@@ -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);
}