mirror of
https://github.com/mpv-player/mpv
synced 2025-02-03 13:41:49 +00:00
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
This commit is contained in:
parent
edd36a3afc
commit
fcde6207a1
@ -523,7 +523,7 @@ int vo_cocoa_check_events(struct vo *vo)
|
|||||||
|
|
||||||
void vo_cocoa_fullscreen(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
|
// This is the secondary thread, unlock since we are going to invoke a
|
||||||
// method synchronously on the GUI thread using Cocoa.
|
// method synchronously on the GUI thread using Cocoa.
|
||||||
vo_cocoa_set_current_context(vo, false);
|
vo_cocoa_set_current_context(vo, false);
|
||||||
@ -535,7 +535,7 @@ void vo_cocoa_fullscreen(struct vo *vo)
|
|||||||
waitUntilDone:YES];
|
waitUntilDone:YES];
|
||||||
|
|
||||||
|
|
||||||
if (![NSThread isMainThread]) {
|
if (![NSThread isMainThread] && resize_callback_registered(vo)) {
|
||||||
// Now lock again!
|
// Now lock again!
|
||||||
vo_cocoa_set_current_context(vo, true);
|
vo_cocoa_set_current_context(vo, true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user