From 7822b970339b49e5c15911b6b15e5b2db6674852 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 24 Oct 2014 20:27:28 +0200 Subject: cocoa: perform VOCTRL_SET_UNFS_WINDOW_SIZE asyncronously Apparently if resizing a NSWindow from a secondary thread Cocoa will automatically protect itself using NSViewHierarchyLock and in our case, cause a deadlock. Fixes #1210 --- video/out/cocoa_common.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 12a3fc5f67..dde727f5de 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -686,9 +686,12 @@ int vo_cocoa_control(struct vo *vo, int *events, int request, void *arg) return VO_TRUE; } case VOCTRL_SET_UNFS_WINDOW_SIZE: { - with_cocoa_lock(vo, ^{ - int *s = arg; - queue_new_video_size(vo, s[0], s[1]); + int *s = arg; + int w, h; + w = s[0]; + h = s[1]; + with_cocoa_lock_on_main_thread(vo, ^{ + queue_new_video_size(vo, w, h); }); return VO_TRUE; } -- cgit v1.2.3