mirror of https://github.com/mpv-player/mpv
stats: print section titles independently
Previously, section titles (File/Video/Audio) were printed as suffix of a property that was assumed to always exist. However, with e.g. lavi-complex this is not the case, therfore, print them without being dependent on a property.
This commit is contained in:
parent
9aa0638f0f
commit
9975835bde
|
@ -424,7 +424,8 @@ end
|
||||||
|
|
||||||
|
|
||||||
local function add_file(s)
|
local function add_file(s)
|
||||||
append_property(s, "filename", {prefix="File:", nl="", indent=""})
|
append(s, "", {prefix=o.nl .. o.nl .. "File:", nl="", indent=""})
|
||||||
|
append_property(s, "filename", {prefix_sep="", nl="", indent=""})
|
||||||
if not (mp.get_property_osd("filename") == mp.get_property_osd("media-title")) then
|
if not (mp.get_property_osd("filename") == mp.get_property_osd("media-title")) then
|
||||||
append_property(s, "media-title", {prefix="Title:"})
|
append_property(s, "media-title", {prefix="Title:"})
|
||||||
end
|
end
|
||||||
|
@ -471,7 +472,8 @@ local function add_video(s)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if append_property(s, "video-codec", {prefix=o.nl .. o.nl .. "Video:", nl="", indent=""}) then
|
append(s, "", {prefix=o.nl .. o.nl .. "Video:", nl="", indent=""})
|
||||||
|
if append_property(s, "video-codec", {prefix_sep="", nl="", indent=""}) then
|
||||||
append_property(s, "hwdec-current", {prefix="(hwdec:", nl="", indent=" ",
|
append_property(s, "hwdec-current", {prefix="(hwdec:", nl="", indent=" ",
|
||||||
no_prefix_markup=true, suffix=")"}, {no=true, [""]=true})
|
no_prefix_markup=true, suffix=")"}, {no=true, [""]=true})
|
||||||
end
|
end
|
||||||
|
@ -533,7 +535,8 @@ local function add_audio(s)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
append_property(s, "audio-codec", {prefix=o.nl .. o.nl .. "Audio:", nl="", indent=""})
|
append(s, "", {prefix=o.nl .. o.nl .. "Audio:", nl="", indent=""})
|
||||||
|
append_property(s, "audio-codec", {prefix_sep="", nl="", indent=""})
|
||||||
append(s, r["samplerate"], {prefix="Sample Rate:", suffix=" Hz"})
|
append(s, r["samplerate"], {prefix="Sample Rate:", suffix=" Hz"})
|
||||||
append(s, r["channel-count"], {prefix="Channels:"})
|
append(s, r["channel-count"], {prefix="Channels:"})
|
||||||
append_property(s, "packet-audio-bitrate", {prefix="Bitrate:", suffix=" kbps"})
|
append_property(s, "packet-audio-bitrate", {prefix="Bitrate:", suffix=" kbps"})
|
||||||
|
|
Loading…
Reference in New Issue