From 9d8495a9603a0d5a99467c986fc50ea871960eec Mon Sep 17 00:00:00 2001 From: Julian Date: Tue, 19 Jul 2016 16:11:51 +0900 Subject: stats: save ASS sequences locally Instead of querying them constantly. Also add a tiny bit of documentation to some variables. --- player/lua/stats.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/player/lua/stats.lua b/player/lua/stats.lua index 1cc526b992..001de404f1 100644 --- a/player/lua/stats.lua +++ b/player/lua/stats.lua @@ -65,19 +65,26 @@ local o = { options.read_options(o) local format = string.format +-- Buffer for the "last" value of performance data for render/present/upload local plast = {{0}, {0}, {0}} +-- Position in buffer local ppos = 1 +-- Length of buffer local plen = 50 +-- Function used to record performance data local recorder = nil -local timer - +-- Timer used for toggling +local timer = nil +-- Save these sequences locally as we'll need them a lot +local ass_start = mp.get_property_osd("osd-ass-cc/0") +local ass_stop = mp.get_property_osd("osd-ass-cc/1") local function set_ASS(b) if not o.ass_formatting then return "" end - return mp.get_property_osd("osd-ass-cc/" .. (b and "0" or "1")) + return b and ass_start or ass_stop end -- cgit v1.2.3