summaryrefslogtreecommitdiffstats
path: root/player/lua
diff options
context:
space:
mode:
authorJulian <MyFakeAcc.4@googlemail.com>2017-07-05 00:31:44 +0200
committerwm4 <wm4@nowhere>2017-10-09 20:40:32 +0200
commit9470ccd8ae9141fa0bd5e46ecd64627c9cbdee93 (patch)
tree8eca20a6b56db733d893afb0be1f424a76723f34 /player/lua
parentb93efd0a52daa7d4204c040b904fec4d99abcc36 (diff)
downloadmpv-9470ccd8ae9141fa0bd5e46ecd64627c9cbdee93.tar.bz2
mpv-9470ccd8ae9141fa0bd5e46ecd64627c9cbdee93.tar.xz
stats: correctly re-eval ASS tag usage
Fixes #42
Diffstat (limited to 'player/lua')
-rw-r--r--player/lua/stats.lua28
1 files changed, 17 insertions, 11 deletions
diff --git a/player/lua/stats.lua b/player/lua/stats.lua
index ef4bd2a9b9..b69425c0ed 100644
--- a/player/lua/stats.lua
+++ b/player/lua/stats.lua
@@ -57,11 +57,11 @@ local o = {
-- Text formatting
-- With ASS
- nl = "\\N",
- indent = "\\h\\h\\h\\h\\h",
- prefix_sep = "\\h\\h",
- b1 = "{\\b1}",
- b0 = "{\\b0}",
+ ass_nl = "\\N",
+ ass_indent = "\\h\\h\\h\\h\\h",
+ ass_prefix_sep = "\\h\\h",
+ ass_b1 = "{\\b1}",
+ ass_b0 = "{\\b0}",
-- Without ASS
no_ass_nl = "\n",
no_ass_indent = "\t",
@@ -118,7 +118,7 @@ end
local function set_ASS(b)
- if not o.ass_formatting then
+ if not o.use_ass then
return ""
end
return b and ass_start or ass_stop
@@ -136,7 +136,7 @@ end
local function text_style()
- if not o.ass_formatting then
+ if not o.use_ass then
return ""
end
if o.custom_header and o.custom_header ~= "" then
@@ -323,7 +323,7 @@ local function append_perfdata(s, full)
hl(pass["avg"], avg_s[frame]), hl(pass["peak"]),
o.font, o.prefix_sep, o.prefix_sep, pass["desc"])
- if o.plot_perfdata and o.ass_formatting then
+ if o.plot_perfdata and o.use_ass then
s[#s+1] = generate_graph(pass["samples"], pass["count"],
pass["count"], pass["peak"],
pass["avg"], 0.9, 0.25)
@@ -362,7 +362,7 @@ local function append_display_sync(s)
end
-- As we need to plot some graphs we print jitter and ratio on their own lines
- if toggle_timer:is_enabled() and (o.plot_vsync_ratio or o.plot_vsync_jitter) and o.ass_formatting then
+ if toggle_timer:is_enabled() and (o.plot_vsync_ratio or o.plot_vsync_jitter) and o.use_ass then
local ratio_graph = ""
local jitter_graph = ""
if o.plot_vsync_ratio then
@@ -478,8 +478,14 @@ end
-- Determine whether ASS formatting shall/can be used
local function eval_ass_formatting()
- o.ass_formatting = o.ass_formatting and has_vo_window()
- if not o.ass_formatting then
+ o.use_ass = o.ass_formatting and has_vo_window()
+ if o.use_ass then
+ o.nl = o.ass_nl
+ o.indent = o.ass_indent
+ o.prefix_sep = o.ass_prefix_sep
+ o.b1 = o.ass_b1
+ o.b0 = o.ass_b0
+ else
o.nl = o.no_ass_nl
o.indent = o.no_ass_indent
o.prefix_sep = o.no_ass_prefix_sep