mirror of https://github.com/mpv-player/mpv
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. Fixese2284fba18
. This actually has an edge case sincee2284fba18
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.
This commit is contained in:
parent
bb0b9f4cc8
commit
5dc4047415
|
@ -194,8 +194,7 @@ mp.observe_property("profile-list", "native", function (_, profiles_property)
|
||||||
load_profiles(profiles_property)
|
load_profiles(profiles_property)
|
||||||
|
|
||||||
if #profiles < 1 and mp.get_property("load-auto-profiles") == "auto" then
|
if #profiles < 1 and mp.get_property("load-auto-profiles") == "auto" then
|
||||||
-- make it exit immediately
|
exit()
|
||||||
_G.mp_event_loop = function() end
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue