diff options
Diffstat (limited to 'player/main.c')
-rw-r--r-- | player/main.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/player/main.c b/player/main.c index bb83accb7e..bb80591220 100644 --- a/player/main.c +++ b/player/main.c @@ -154,18 +154,9 @@ void mp_print_version(struct mp_log *log, int always) } } -static void shutdown_clients(struct MPContext *mpctx) -{ - mp_client_enter_shutdown(mpctx); - while (mp_clients_num(mpctx) || mpctx->outstanding_async) { - mp_client_broadcast_event(mpctx, MPV_EVENT_SHUTDOWN, NULL); - mp_wait_events(mpctx); - } -} - void mp_destroy(struct MPContext *mpctx) { - shutdown_clients(mpctx); + mp_shutdown_clients(mpctx); mp_uninit_ipc(mpctx->ipc_ctx); mpctx->ipc_ctx = NULL; @@ -199,9 +190,6 @@ void mp_destroy(struct MPContext *mpctx) uninit_libav(mpctx->global); - if (mpctx->autodetach) - pthread_detach(pthread_self()); - mp_msg_uninit(mpctx->global); pthread_mutex_destroy(&mpctx->lock); talloc_free(mpctx); @@ -461,6 +449,8 @@ int mpv_main(int argc, char *argv[]) if (!mpctx) return 1; + mpctx->is_cli = true; + char **options = argv && argv[0] ? argv + 1 : NULL; // skips program name int r = mp_initialize(mpctx, options); if (r == 0) |