diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-10-21 04:55:41 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-11-05 17:36:17 +0000 |
commit | 174df99ffa53f1091589eaa4fa0c16cdd55a9326 (patch) | |
tree | 3a60d45615f18beed98a9b08267c28ed7e05dd5f /osdep/macosx_application.m | |
parent | 3a8b107f6216b38a151d5ca1e9d4f2727e3418f5 (diff) | |
download | mpv-174df99ffa53f1091589eaa4fa0c16cdd55a9326.tar.bz2 mpv-174df99ffa53f1091589eaa4fa0c16cdd55a9326.tar.xz |
ALL: use new mp_thread abstraction
Diffstat (limited to 'osdep/macosx_application.m')
-rw-r--r-- | osdep/macosx_application.m | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index 78fcb5cb48..6b526d295c 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -16,7 +16,6 @@ */ #include <stdio.h> -#include <pthread.h> #include "config.h" #include "mpv_talloc.h" @@ -88,7 +87,7 @@ const struct m_sub_options macos_conf = { // running in libmpv mode, and cocoa_main() was never called. static bool application_instantiated; -static pthread_t playback_thread_id; +static mp_thread playback_thread_id; @interface Application () { @@ -273,9 +272,9 @@ static void cocoa_run_runloop(void) [pool drain]; } -static void *playback_thread(void *ctx_obj) +static MP_THREAD_VOID playback_thread(void *ctx_obj) { - mpthread_set_name("core/playback"); + mp_thread_set_name("core/playback"); @autoreleasepool { struct playback_thread_ctx *ctx = (struct playback_thread_ctx*) ctx_obj; int r = mpv_main(*ctx->argc, *ctx->argv); @@ -364,7 +363,7 @@ int cocoa_main(int argc, char *argv[]) init_cocoa_application(false); } - pthread_create(&playback_thread_id, NULL, playback_thread, &ctx); + mp_thread_create(&playback_thread_id, playback_thread, &ctx); [[EventsResponder sharedInstance] waitForInputContext]; cocoa_run_runloop(); @@ -373,7 +372,7 @@ int cocoa_main(int argc, char *argv[]) fprintf(stderr, "There was either a problem " "initializing Cocoa or the Runloop was stopped unexpectedly. " "Please report this issues to a developer.\n"); - pthread_join(playback_thread_id, NULL); + mp_thread_join(playback_thread_id); return 1; } } |