stats: save ASS sequences locally

Instead of querying them constantly.
Also add a tiny bit of documentation to some variables.
This commit is contained in:
Julian 2016-07-19 16:11:51 +09:00 committed by wm4
parent 9b439e9453
commit 9d8495a960
1 changed files with 10 additions and 3 deletions

View File

@ -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