TOOLS/lua/gamma-auto: update on timer when on Linux

The Linux implementation of ambient-light is not observable.
This commit is contained in:
LordMZTE
2025-10-15 21:59:42 +02:00
committed by Kacper Michajłow
parent df939d4fe8
commit f9d4e19888
+8 -1
View File
@@ -19,4 +19,11 @@ local function lux_changed(_, lux)
mp.set_property_number("gamma-factor", gamma)
end
mp.observe_property("ambient-light", "number", lux_changed)
if mp.get_property("platform") == "linux" then
-- observing ambient-light isn't supported on Linux
mp.add_periodic_timer(1, function()
lux_changed(nil, mp.get_property_number("ambient-light"))
end)
else
mp.observe_property("ambient-light", "number", lux_changed)
end