summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-13 13:48:47 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:34 +0200
commit7428cc51496ca8e56600fdc4034b8f55720f09f9 (patch)
tree4e09e1818b2e60ccf1db3b1ba04cb227275a658f /player/loadfile.c
parent4e05f75261d997cfc48227f5ac1ab8f18101c437 (diff)
downloadmpv-7428cc51496ca8e56600fdc4034b8f55720f09f9.tar.bz2
mpv-7428cc51496ca8e56600fdc4034b8f55720f09f9.tar.xz
client API: kill async commands on termination
This affects async commands started by client API, commands with async capability run in a sync way by client API (think mpv_command_node() with "subprocess"), and detached async work. Since scripts might want to do some cleanup work (that might involve launching processes, don't ask), we don't unconditionally kill everything on exit, but apply an arbitrary timeout of 2 seconds until async commands are aborted.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index 6f28d2ee38..c4e013793d 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -113,8 +113,11 @@ void mp_abort_remove(struct MPContext *mpctx, struct mp_abort_entry *abort)
void mp_abort_recheck_locked(struct MPContext *mpctx,
struct mp_abort_entry *abort)
{
- if (abort->coupled_to_playback && mp_cancel_test(mpctx->playback_abort))
+ if ((abort->coupled_to_playback && mp_cancel_test(mpctx->playback_abort)) ||
+ mpctx->abort_all)
+ {
mp_abort_trigger_locked(mpctx, abort);
+ }
}
void mp_abort_trigger_locked(struct MPContext *mpctx,