diff options
-rw-r--r-- | player/lua/osc.lua | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua index fd4a3bb3c6..a241f85a9a 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -1221,9 +1221,20 @@ function osc_init() ne = new_element("cache", "button") ne.content = function (ass) - local cache = mp.get_property_number("cache") - if not (cache == nil) and (cache < 45) then - ass:append("Cache: " .. (math.floor(cache)) .."%") + local dmx_cache = mp.get_property_number("demuxer-cache-duration") + if not (dmx_cache == nil) then + dmx_cache = math.floor(dmx_cache + 0.5) .. "s + " + else + dmx_cache = "" + end + local cache_used = mp.get_property_number("cache-used") + if not (cache_used == nil) then + if (cache_used < 1024) then + cache_used = cache_used .. " KB" + else + cache_used = math.floor((cache_used/102.4)+0.5)/10 .. " MB" + end + ass:append("Cache: " .. dmx_cache .. cache_used) end end |