diff options
author | ChrisK2 <spam@kalania.de> | 2014-09-25 11:57:49 +0200 |
---|---|---|
committer | ChrisK2 <spam@kalania.de> | 2014-09-25 11:57:49 +0200 |
commit | 1c9f30cca7b877f988c735735d023014cc554a07 (patch) | |
tree | bcf460956b4e4d29f5316d57052c34ae56f70b59 /player | |
parent | 7aa933cc9ee4e504dc3bb716a3736d138c5bd7c2 (diff) | |
download | mpv-1c9f30cca7b877f988c735735d023014cc554a07.tar.bz2 mpv-1c9f30cca7b877f988c735735d023014cc554a07.tar.xz |
osc: update cache display
now similar to what the status line displays
Diffstat (limited to 'player')
-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 |