summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-12 18:48:35 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:34 +0200
commitdbe831bd025d34930b97c493d9ef61278408cf46 (patch)
tree3430a50e39d1785b5ba919bd5180bdc67dfcf6e0 /TOOLS
parent9c530c7ee9ac0641e58ac1203bd46675e8700cc5 (diff)
downloadmpv-dbe831bd025d34930b97c493d9ef61278408cf46.tar.bz2
mpv-dbe831bd025d34930b97c493d9ef61278408cf46.tar.xz
lua: expose mpv_abort_async_command()
Also somewhat cleans up mp.command_native_async() error handling.
Diffstat (limited to 'TOOLS')
-rw-r--r--TOOLS/lua/command-test.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/TOOLS/lua/command-test.lua b/TOOLS/lua/command-test.lua
index 94a91c2f57..1a8d86b4dd 100644
--- a/TOOLS/lua/command-test.lua
+++ b/TOOLS/lua/command-test.lua
@@ -55,4 +55,13 @@ mp.observe_property("vo-configured", "bool", function(_, v)
function(res, val, err)
print("done subprocess: " .. join(" ", {res, val, err}))
end)
+
+ local x = mp.command_native_async({name = "subprocess", args = {"sleep", "inf"}},
+ function(res, val, err)
+ print("done sleep inf subprocess: " .. join(" ", {res, val, err}))
+ end)
+ mp.add_timeout(15, function()
+ print("aborting sleep inf subprocess after timeout")
+ mp.abort_async_command(x)
+ end)
end)