From 97816bbef0f97cfda7abdbe560707481d5f68ccd Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Fri, 29 Dec 2017 12:07:41 +0000 Subject: osc: check if demuxer cache has not reached eof Avoids flickering stream cache status while filling the demuxer cache. --- player/lua/osc.lua | 6 +++--- 1 file 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. -- cgit v1.2.3