mirror of
https://github.com/mpv-player/mpv.git
synced 2026-06-06 20:10:30 +00:00
TOOLS/lua/gamma-auto: update on timer when on Linux
The Linux implementation of ambient-light is not observable.
This commit is contained in:
committed by
Kacper Michajłow
parent
df939d4fe8
commit
f9d4e19888
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user