diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-10-24 20:27:28 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-10-24 20:30:53 +0200 |
commit | 7822b970339b49e5c15911b6b15e5b2db6674852 (patch) | |
tree | bb2c2d40354be8a0bbfcf58e48a522a015c4ba25 /video/out/cocoa_common.m | |
parent | 480f82fa96b99b15d180e1cf2829f31071bc377a (diff) | |
download | mpv-7822b970339b49e5c15911b6b15e5b2db6674852.tar.bz2 mpv-7822b970339b49e5c15911b6b15e5b2db6674852.tar.xz |
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
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r-- | video/out/cocoa_common.m | 9 |
1 files 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; } |