summaryrefslogtreecommitdiffstats
path: root/player/lua
diff options
context:
space:
mode:
authorFunami580 <Funami580@users.noreply.github.com>2021-11-26 17:15:50 +0100
committeravih <avih@users.noreply.github.com>2021-11-27 21:37:24 +0200
commit448fe0226b469df9f8a109a9840afa00bc59b48c (patch)
treea191ee250493bad49e4f31c5b14ce5eeb6d3ecf1 /player/lua
parentcc4ac14d514a05ba5526b96c3f6a4730f330a96a (diff)
downloadmpv-448fe0226b469df9f8a109a9840afa00bc59b48c.tar.bz2
mpv-448fe0226b469df9f8a109a9840afa00bc59b48c.tar.xz
osc: fix cache displaying 60s in some cases
It was caused by string.format rounding e.g. 59.9 to 60.
Diffstat (limited to 'player/lua')
-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 62f8245995..595dfc2521 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -2095,10 +2095,10 @@ function osc_init()
dmx_cache = state.dmx_cache
end
local min = math.floor(dmx_cache / 60)
- local sec = dmx_cache % 60
+ local sec = math.floor(dmx_cache % 60) -- don't round e.g. 59.9 to 60
return "Cache: " .. (min > 0 and
string.format("%sm%02.0fs", min, sec) or
- string.format("%3.0fs", dmx_cache))
+ string.format("%3.0fs", sec))
end
-- volume