mirror of
https://github.com/mpv-player/mpv
synced 2025-04-11 04:01:31 +00:00
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.
This commit is contained in:
parent
b8a431c892
commit
c8cf864bff
@ -71,7 +71,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_COCOA
|
#if HAVE_COCOA_APPLICATION
|
||||||
#include "osdep/macosx_application.h"
|
#include "osdep/macosx_application.h"
|
||||||
#include "osdep/macosx_events.h"
|
#include "osdep/macosx_events.h"
|
||||||
#endif
|
#endif
|
||||||
@ -160,7 +160,7 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx,
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
#if HAVE_COCOA
|
#if HAVE_COCOA_APPLICATION
|
||||||
cocoa_set_input_context(NULL);
|
cocoa_set_input_context(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx,
|
|||||||
|
|
||||||
mp_destroy(mpctx);
|
mp_destroy(mpctx);
|
||||||
|
|
||||||
#if HAVE_COCOA
|
#if HAVE_COCOA_APPLICATION
|
||||||
terminate_cocoa_application();
|
terminate_cocoa_application();
|
||||||
// never reach here:
|
// never reach here:
|
||||||
// terminate calls exit itself, just silence compiler warning
|
// terminate calls exit itself, just silence compiler warning
|
||||||
@ -421,7 +421,7 @@ int mp_initialize(struct MPContext *mpctx)
|
|||||||
|
|
||||||
mp_get_resume_defaults(mpctx);
|
mp_get_resume_defaults(mpctx);
|
||||||
|
|
||||||
#if HAVE_COCOA
|
#if HAVE_COCOA_APPLICATION
|
||||||
if (mpctx->is_cplayer)
|
if (mpctx->is_cplayer)
|
||||||
cocoa_set_input_context(mpctx->input);
|
cocoa_set_input_context(mpctx->input);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
|
|
||||||
#if HAVE_COCOA
|
#if HAVE_COCOA_APPLICATION
|
||||||
#include "osdep/macosx_application.h"
|
#include "osdep/macosx_application.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#if HAVE_COCOA
|
#if HAVE_COCOA_APPLICATION
|
||||||
return cocoa_main(mpv_main, argc, argv);
|
return cocoa_main(mpv_main, argc, argv);
|
||||||
#else
|
#else
|
||||||
return mpv_main(argc, argv);
|
return mpv_main(argc, argv);
|
||||||
|
Loading…
Reference in New Issue
Block a user