History

lua: expose mpv_abort_async_command()

Also somewhat cleans up mp.command_native_async() error handling.

wm4 committed 8 years ago

Commit dbe831b1 parent 9c530c74 files · +47 −3Browse files

Showing the changes to TOOLS/lua/command-test.lua (1 of 4 files). Show all

Unified · Split

TOOLS/lua/command-test.lua+9−0
@@ -55,4 +55,13 @@ mp.observe_property("vo-configured", "bool", function(_, v) · 54 unmodified lines
5555 function(res, val, err)
5656 print("done subprocess: " .. join(" ", {res, val, err}))
5757 end)
58+
59+ local x = mp.command_native_async({name = "subprocess", args = {"sleep", "inf"}},
60+ function(res, val, err)
61+ print("done sleep inf subprocess: " .. join(" ", {res, val, err}))
62+ end)
63+ mp.add_timeout(15, function()
64+ print("aborting sleep inf subprocess after timeout")
65+ mp.abort_async_command(x)
66+ end)
5867 end)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t