1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-25 04:38:01 +00:00

stats: add current and total chapter number

Fixes #44
(well, partially, I'm still not sure about the time)
This commit is contained in:
Julian 2017-08-25 23:57:17 +02:00 committed by wm4
parent 01f2798e04
commit 54b3a9fdb0

View File

@ -452,7 +452,14 @@ local function add_file(s)
if not (mp.get_property_osd("filename") == mp.get_property_osd("media-title")) then
append_property(s, "media-title", {prefix="Title:"})
end
append_property(s, "chapter", {prefix="Chapter:"})
local ch_index = mp.get_property_number("chapter")
if ch_index and ch_index >= 0 then
append_property(s, "chapter-list/" .. tostring(ch_index) .. "/title", {prefix="Chapter:"})
append_property(s, "chapter-list/count",
{prefix="(" .. tostring(ch_index + 1) .. "/", suffix=")", nl="",
indent=" ", prefix_sep=" ", no_prefix_markup=true})
end
if append_property(s, "cache-used", {prefix="Cache:"}) then
append_property(s, "demuxer-cache-duration",
{prefix="+", suffix=" sec", nl="", indent=o.prefix_sep,