diff options
author | wm4 <wm4@nowhere> | 2015-05-02 18:47:57 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-05-02 18:59:58 +0200 |
commit | 1e7831070f6ae1af0a1a29b0d680ef2907bf8cf6 (patch) | |
tree | 0d5bc34cfcdf029b8a22deb98c4f0e73c4266d57 /osdep/macosx_application.m | |
parent | 19a5b20752ecc7465cf17781f908e12bf4ca136d (diff) | |
download | mpv-1e7831070f6ae1af0a1a29b0d680ef2907bf8cf6.tar.bz2 mpv-1e7831070f6ae1af0a1a29b0d680ef2907bf8cf6.tar.xz |
build: move main-fn files to osdep
And split the Cocoa and Unix cases. Simplify the Cocoa case slightly by
calling mpv_main directly, instead of passing a function pointer. Also
add a comment explaining why Cocoa needs a special case at all.
Diffstat (limited to 'osdep/macosx_application.m')
-rw-r--r-- | osdep/macosx_application.m | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index 2ff3386f76..595c47e3c6 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -26,6 +26,7 @@ #include "osdep/macosx_compat.h" #import "osdep/macosx_events_objc.h" #include "osdep/threads.h" +#include "osdep/main-fn.h" #define MPV_PROTOCOL @"mpv://" @@ -252,7 +253,6 @@ static void terminate_cocoa_application(void) @end struct playback_thread_ctx { - mpv_main_fn mpv_main; int *argc; char ***argv; }; @@ -269,7 +269,7 @@ static void *playback_thread(void *ctx_obj) mpthread_set_name("playback core (OSX)"); @autoreleasepool { struct playback_thread_ctx *ctx = (struct playback_thread_ctx*) ctx_obj; - int r = ctx->mpv_main(*ctx->argc, *ctx->argv); + int r = mpv_main(*ctx->argc, *ctx->argv); terminate_cocoa_application(); // normally never reached - unless the cocoa mainloop hasn't started yet exit(r); @@ -361,13 +361,12 @@ static bool bundle_started_from_finder(int argc, char **argv) } } -int cocoa_main(mpv_main_fn mpv_main, int argc, char *argv[]) +int cocoa_main(int argc, char *argv[]) { @autoreleasepool { application_instantiated = true; struct playback_thread_ctx ctx = {0}; - ctx.mpv_main = mpv_main; ctx.argc = &argc; ctx.argv = &argv; |