History

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.

Guido Cella committed 2 years ago

Commit 5dc40471 parent bb0b9f41 file · +1 −2Browse files

Showing the changes to player/lua/auto_profiles.lua (1 of 1 file). Show all

Unified · Split

player/lua/auto_profiles.lua+1−2
@@ -194,8 +194,7 @@ mp.observe_property("profile-list", "native", function (_, profiles_property) · 193 unmodified lines
194 load_profiles(profiles_property)194 load_profiles(profiles_property)
195 195
196 if #profiles < 1 and mp.get_property("load-auto-profiles") == "auto" then196 if #profiles < 1 and mp.get_property("load-auto-profiles") == "auto" then
197 -- make it exit immediately197 exit()
198 _G.mp_event_loop = function() end
199 return198 return
200 end199 end
201 200

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