History

player: "subprocess" command should stop immediately in idle mode

The description of the "playback_only" field in the "subprocess" command says "you can't start it outside of playback". This did not work correctly: if the player was started in idle mode in the first place, the subprocess was allowed to run even with playback_only=yes. This is a bug, and this change fixes it. Add a test for this to command-test.lua. For #7025.

wm4 committed 7 years ago

Commit 60647201 parent e49cec52 files · +15 −3Browse files

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

Unified · Split

TOOLS/lua/command-test.lua+13−3
@@ -86,10 +86,20 @@ mp.observe_property("vo-configured", "bool", function(_, v) · 85 unmodified lines
8686 playback_only = false, args = {"sleep", "inf"}})
8787 end)
8888
89−mp.register_event("shutdown", function()
89+function freeze_test(playback_only)
9090 -- This "freezes" the script, should be killed via timeout.
91− print("freeze!")
92− local x = mp.command_native({name = "subprocess", playback_only = false,
91+ counter = counter and counter + 1 or 0
92+ print("freeze! " .. counter)
93+ local x = mp.command_native({name = "subprocess",
94+ playback_only = playback_only,
9395 args = {"sleep", "inf"}})
9496 print("done, killed=" .. utils.to_string(x.killed_by_us))
97+end
98+
99+mp.register_event("shutdown", function()
100+ freeze_test(false)
101+end)
102+
103+mp.register_event("idle", function()
104+ freeze_test(true)
95105 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