summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TOOLS/lua/command-test.lua16
-rw-r--r--player/main.c2
2 files changed, 15 insertions, 3 deletions
diff --git a/TOOLS/lua/command-test.lua b/TOOLS/lua/command-test.lua
index dd384818cc..30d8cc05ff 100644
--- a/TOOLS/lua/command-test.lua
+++ b/TOOLS/lua/command-test.lua
@@ -86,10 +86,20 @@ mp.observe_property("vo-configured", "bool", function(_, v)
playback_only = false, args = {"sleep", "inf"}})
end)
-mp.register_event("shutdown", function()
+function freeze_test(playback_only)
-- This "freezes" the script, should be killed via timeout.
- print("freeze!")
- local x = mp.command_native({name = "subprocess", playback_only = false,
+ counter = counter and counter + 1 or 0
+ print("freeze! " .. counter)
+ local x = mp.command_native({name = "subprocess",
+ playback_only = playback_only,
args = {"sleep", "inf"}})
print("done, killed=" .. utils.to_string(x.killed_by_us))
+end
+
+mp.register_event("shutdown", function()
+ freeze_test(false)
+end)
+
+mp.register_event("idle", function()
+ freeze_test(true)
end)
diff --git a/player/main.c b/player/main.c
index 4ab25a942c..bc6a3b1f97 100644
--- a/player/main.c
+++ b/player/main.c
@@ -319,6 +319,8 @@ struct MPContext *mp_create(void)
if (verbose_env)
mpctx->opts->verbose = atoi(verbose_env);
+ mp_cancel_trigger(mpctx->playback_abort);
+
return mpctx;
}