From c8cf864bfff3e56c45f129e9d825cb41d54a647e Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 4 Aug 2014 08:39:30 +0200 Subject: cocoa: fix build by using the correct HAVE_* macro This builds but both the libmpv example and the cplayer block infinitely when building libmpv. That's because we wait inifinitely in `dispatch_sync` as there's no event loop in the main thread that allows for libdispatch to work.. Whiel we are at it, we should probably investigate how to use mp_dispatch instead since it is a little lower level and could give us higher control in building and event loop. --- player/main.c | 8 ++++---- player/main_fn.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/player/main.c b/player/main.c index 288dbbd89e..9de780282f 100644 --- a/player/main.c +++ b/player/main.c @@ -71,7 +71,7 @@ #endif #endif -#if HAVE_COCOA +#if HAVE_COCOA_APPLICATION #include "osdep/macosx_application.h" #include "osdep/macosx_events.h" #endif @@ -160,7 +160,7 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx, { int rc; -#if HAVE_COCOA +#if HAVE_COCOA_APPLICATION cocoa_set_input_context(NULL); #endif @@ -200,7 +200,7 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx, mp_destroy(mpctx); -#if HAVE_COCOA +#if HAVE_COCOA_APPLICATION terminate_cocoa_application(); // never reach here: // terminate calls exit itself, just silence compiler warning @@ -421,7 +421,7 @@ int mp_initialize(struct MPContext *mpctx) mp_get_resume_defaults(mpctx); -#if HAVE_COCOA +#if HAVE_COCOA_APPLICATION if (mpctx->is_cplayer) cocoa_set_input_context(mpctx->input); #endif diff --git a/player/main_fn.c b/player/main_fn.c index 87e1681987..23a047b4dc 100644 --- a/player/main_fn.c +++ b/player/main_fn.c @@ -1,13 +1,13 @@ #include "config.h" #include "core.h" -#if HAVE_COCOA +#if HAVE_COCOA_APPLICATION #include "osdep/macosx_application.h" #endif int main(int argc, char *argv[]) { -#if HAVE_COCOA +#if HAVE_COCOA_APPLICATION return cocoa_main(mpv_main, argc, argv); #else return mpv_main(argc, argv); -- cgit v1.2.3