From 241cbe50655149ac770d81a559be7e6fa8fac8d4 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 13 Feb 2014 13:01:51 +0100 Subject: [PATCH] cocoa: fix deadlock during initialization Thanks to @wm4 for catching the bug. Fixes #405 --- osdep/macosx_application.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index 1ae1752bf1..f047f5f45e 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -330,7 +330,8 @@ int cocoa_main(mpv_main_fn mpv_main, int argc, char *argv[]) pthread_create(&playback_thread_id, NULL, playback_thread, &ctx); [mpv_shared_app().input_ready lock]; - [mpv_shared_app().input_ready wait]; + while (!mpv_shared_app().inputContext) + [mpv_shared_app().input_ready wait]; [mpv_shared_app().input_ready unlock]; cocoa_run_runloop();