summaryrefslogtreecommitdiffstats
path: root/player/lua/ytdl_hook.lua
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-16 23:09:30 +0100
committerwm4 <wm4@nowhere>2020-02-16 23:09:30 +0100
commite0f85553c043fc18dc7f97dd74f2e0da8cf7bc14 (patch)
tree928d4f1a42807e8663e9f6bed29ad7dbcf224d85 /player/lua/ytdl_hook.lua
parent249bb091d4880a564c00f8354111e12cfd0183a3 (diff)
downloadmpv-pidfd_test.tar.bz2
mpv-pidfd_test.tar.xz
linux pidfd_open testpidfd_test
Seems to work. Syscall wrapper copy&pasted from the manpage.
Diffstat (limited to 'player/lua/ytdl_hook.lua')
-rw-r--r--player/lua/ytdl_hook.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
index 8822299671..e489c4edcb 100644
--- a/player/lua/ytdl_hook.lua
+++ b/player/lua/ytdl_hook.lua
@@ -743,3 +743,20 @@ mp.add_hook("on_preloaded", 10, function ()
chapter_list = {}
end
end)
+
+mp.add_forced_key_binding("a", function()
+ print("starting")
+ local ret = mp.command_native_async(
+ {name = "subprocess", args = {"/tmp/test/pid_test"},
+ capture_stdout = true,
+ capture_stderr = true},
+ function(ok, res)
+ print("done " .. utils.format_table(res))
+ end)
+ print("started")
+ -- kill it after some time
+ mp.add_timeout(20, function()
+ print("killing it")
+ mp.abort_async_command(ret)
+ end)
+end) \ No newline at end of file