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.
This commit is contained in:
wm4
2018-05-13 13:48:47 +02:00
parent 4e05f75261
commit 7428cc5149
5 changed files with 65 additions and 14 deletions

View File

@@ -365,6 +365,9 @@ List of Input Commands
This command can be asynchronously aborted via API.
In all cases, the subprocess will be terminated on player exit. Only the
``run`` command can start processes in a truly detached way.
``quit [<code>]``
Exit the player. If an argument is given, it's used as process exit code.