From 9975835bdeec3f2b04b136ef40c70b02487bb0e6 Mon Sep 17 00:00:00 2001 From: Julian Date: Sat, 24 Mar 2018 22:43:04 +0100 Subject: 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. --- player/lua/stats.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/player/lua/stats.lua b/player/lua/stats.lua index d266a5f1b5..ad9cca2224 100644 --- a/player/lua/stats.lua +++ b/player/lua/stats.lua @@ -424,7 +424,8 @@ end 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 append_property(s, "media-title", {prefix="Title:"}) end @@ -471,7 +472,8 @@ local function add_video(s) return 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=" ", no_prefix_markup=true, suffix=")"}, {no=true, [""]=true}) end @@ -533,7 +535,8 @@ local function add_audio(s) return 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["channel-count"], {prefix="Channels:"}) append_property(s, "packet-audio-bitrate", {prefix="Bitrate:", suffix=" kbps"}) -- cgit v1.2.3