1
mirror of https://github.com/mpv-player/mpv synced 2024-11-14 22:48:35 +01:00

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
This commit is contained in:
Stefano Pigozzi 2014-10-24 20:27:28 +02:00
parent 480f82fa96
commit 7822b97033

View File

@ -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;
}