From dbe831bd025d34930b97c493d9ef61278408cf46 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 12 May 2018 18:48:35 +0200 Subject: lua: expose mpv_abort_async_command() Also somewhat cleans up mp.command_native_async() error handling. --- TOOLS/lua/command-test.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'TOOLS') 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) -- cgit v1.2.3