summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Constantino <wiiaboo@gmail.com>2017-12-29 12:07:41 +0000
committerRicardo Constantino <wiiaboo@gmail.com>2018-01-02 14:28:32 +0000
commit97816bbef0f97cfda7abdbe560707481d5f68ccd (patch)
treea5295961cd6855e40e01d65b68e021385fbd2977
parent0da5688c84e33dee1ca0965521ed5c9b8a8e7320 (diff)
downloadmpv-97816bbef0f97cfda7abdbe560707481d5f68ccd.tar.bz2
mpv-97816bbef0f97cfda7abdbe560707481d5f68ccd.tar.xz
osc: check if demuxer cache has not reached eof
Avoids flickering stream cache status while filling the demuxer cache.
-rw-r--r--player/lua/osc.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index 60ddcdb39f..58ee482d1e 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -1839,15 +1839,15 @@ function osc_init()
ne.content = function ()
local dmx_cache = mp.get_property_number("demuxer-cache-duration")
- local cache_used = mp.get_property_number("cache-used", 0) * 1024
+ local cache_used = mp.get_property_number("cache-used")
local dmx_cache_state = mp.get_property_native("demuxer-cache-state", {})
local is_network = mp.get_property_native("demuxer-via-network")
- local show_cache = cache_used > 0
+ local show_cache = cache_used and not dmx_cache_state["eof"]
if dmx_cache then
dmx_cache = string.format("%3.0fs", dmx_cache)
end
if dmx_cache_state["fw-bytes"] then
- cache_used = cache_used + dmx_cache_state["fw-bytes"]
+ cache_used = (cache_used or 0)*1024 + dmx_cache_state["fw-bytes"]
end
if (is_network and dmx_cache) or show_cache then
-- Only show dmx-cache-duration by itself if it's a network file.