From 5dc4047415e141f970a4bd5bc548be82168bb66a Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Fri, 1 Nov 2024 16:30:42 +0100 Subject: [PATCH] auto_profiles.lua: actually exit when no auto profiles are defined Unsetting _G.mp_event_loop at the top level quits the script, but not within callbacks. Use the new exit() function instead. Fixes e2284fba18. This actually has an edge case since e2284fba18 where you can add auto profiles only later with load-config-file and the script stays unloaded, but it's still reasonable to quit if mpv.conf has no conditional profiles. You could always explicitly set --load-auto-profiles=yes in this case. --- player/lua/auto_profiles.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/player/lua/auto_profiles.lua b/player/lua/auto_profiles.lua index 167724344cf23..bf1c79721c809 100644 --- a/player/lua/auto_profiles.lua +++ b/player/lua/auto_profiles.lua @@ -194,8 +194,7 @@ mp.observe_property("profile-list", "native", function (_, profiles_property) load_profiles(profiles_property) if #profiles < 1 and mp.get_property("load-auto-profiles") == "auto" then - -- make it exit immediately - _G.mp_event_loop = function() end + exit() return end