mirror of https://github.com/mpv-player/mpv
cocoa: fix exiting the command line player
Commite920a00eb
assumed that terminate_cocoa_application() actually would exit. But apparently that is not always the case; e.g. mpv --help will just hang. The old code had a dummy exit(0), which was apparently actually called. Fix by explicitly exiting if mpv_main() returns and terminate_cocoa_application() does nothing. (cherry picked from commit9e14042e57
)
This commit is contained in:
parent
440ba33639
commit
cb5adf4d72
|
@ -273,11 +273,10 @@ 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;
|
||||
ctx->mpv_main(*ctx->argc, *ctx->argv);
|
||||
int r = ctx->mpv_main(*ctx->argc, *ctx->argv);
|
||||
terminate_cocoa_application();
|
||||
// normally never reached
|
||||
cocoa_stop_runloop();
|
||||
pthread_exit(NULL);
|
||||
// normally never reached - unless the cocoa mainloop hasn't started yet
|
||||
exit(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue