Skip to content

Commit

Permalink
stats.lua: add subtitles section
Browse files Browse the repository at this point in the history
  • Loading branch information
kasper93 committed Apr 15, 2024
1 parent 69b0bcb commit 56fe5ea
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions player/lua/stats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,20 @@ local function add_audio(s)
end


local function add_subtitles(s)
local ci = mp.get_property_native("sub-codec-info")
if not ci then
return
end

local desc = ci["desc"] and string.gsub(ci["desc"], "%s*subtitles?$", "")
append(s, "", {prefix=o.nl .. o.nl .. "Subtitles:", nl="", indent=""})
append(s, desc or ci["name"], {prefix_sep="", nl="", indent=""})
append(s, ci["profile"], {prefix="[", nl="", indent=" ", prefix_sep="",
no_prefix_markup=true, suffix="]"})
end


-- Determine whether ASS formatting shall/can be used and set formatting sequences
local function eval_ass_formatting()
o.use_ass = o.ass_formatting and has_vo_window()
Expand Down Expand Up @@ -1090,6 +1104,7 @@ local function default_stats()
add_video_out(stats)
add_video(stats)
add_audio(stats)
add_subtitles(stats)
return finalize_page({}, stats, false)
end

Expand Down

0 comments on commit 56fe5ea

Please sign in to comment.