From 40832773c183d9e9e475c4807d3bb7866c5bbad9 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Sat, 11 Jan 2020 14:40:46 +0200 Subject: osc: more frequent cache updates: from 10% diff to 5% or 5s Cache display updates, especially when it's bigger than few minute, could have been be very infrequent to the point that one is not sure if it updates at all. Reduce the 10% change-threshold to 5% and add another threshold of 5s. --- player/lua/osc.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 408ca47c91..e6a1e249dd 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -2021,8 +2021,8 @@ function osc_init() return "" end local dmx_cache = mp.get_property_number("demuxer-cache-duration") - if dmx_cache and (dmx_cache > state.dmx_cache * 1.1 or - dmx_cache < state.dmx_cache * 0.9) then + local thresh = math.min(state.dmx_cache * 0.05, 5) -- 5% or 5s + if dmx_cache and math.abs(dmx_cache - state.dmx_cache) >= thresh then state.dmx_cache = dmx_cache else dmx_cache = state.dmx_cache -- cgit v1.2.3