summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2020-01-11 14:40:46 +0200
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2020-01-14 13:15:48 +0200
commit40832773c183d9e9e475c4807d3bb7866c5bbad9 (patch)
treee3485a5919eb8faecee1d0495aa81a68e95e7928
parent3259494d9e58b710592e34b0f739942f0f941acb (diff)
downloadmpv-40832773c183d9e9e475c4807d3bb7866c5bbad9.tar.bz2
mpv-40832773c183d9e9e475c4807d3bb7866c5bbad9.tar.xz
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.
-rw-r--r--player/lua/osc.lua4
1 files 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