diff options
author | Funami580 <Funami580@users.noreply.github.com> | 2021-11-26 17:15:50 +0100 |
---|---|---|
committer | avih <avih@users.noreply.github.com> | 2021-11-27 21:37:24 +0200 |
commit | 448fe0226b469df9f8a109a9840afa00bc59b48c (patch) | |
tree | a191ee250493bad49e4f31c5b14ce5eeb6d3ecf1 | |
parent | cc4ac14d514a05ba5526b96c3f6a4730f330a96a (diff) | |
download | mpv-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.
-rw-r--r-- | player/lua/osc.lua | 4 |
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 |