summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-02-13 13:01:51 +0100
committerwm4 <wm4@nowhere>2014-03-11 00:04:07 +0100
commit241cbe50655149ac770d81a559be7e6fa8fac8d4 (patch)
tree24609feeef4338e79ed8c894a5f4e1de74d69772
parent76d771a6fa4bf5b6aa2b654185a85a77e3fb33ac (diff)
downloadmpv-241cbe50655149ac770d81a559be7e6fa8fac8d4.tar.bz2
mpv-241cbe50655149ac770d81a559be7e6fa8fac8d4.tar.xz
cocoa: fix deadlock during initialization
Thanks to @wm4 for catching the bug. Fixes #405
-rw-r--r--osdep/macosx_application.m3
1 files changed, 2 insertions, 1 deletions
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();