mirror of https://github.com/mpv-player/mpv
osc: fix cache displaying 60s in some cases
It was caused by string.format rounding e.g. 59.9 to 60.
This commit is contained in:
parent
cc4ac14d51
commit
448fe0226b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue