From 6f17a5efe3929dc1a330471382137a5fcc075f12 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Fri, 10 Nov 2023 23:57:18 -0500 Subject: stats.lua: fix incorrect storage aspect ratio value The "Resolution" property shows the storage resolution for videos with non-square pixels. Currently, display aspect ratio is shown for both "Resolution" and "Output Resolution" properties which results in a duplicate, and is incorrect for the "Resolution" property. The correct aspect ratio is now shown using the sar and sar-name properties. --- player/lua/stats.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'player/lua/stats.lua') diff --git a/player/lua/stats.lua b/player/lua/stats.lua index 9bde07951f..16e8b6861f 100644 --- a/player/lua/stats.lua +++ b/player/lua/stats.lua @@ -686,12 +686,18 @@ local function append_resolution(s, r, prefix, w_prop, h_prop, video_res) if append(s, r[w_prop], {prefix=prefix}) then append(s, r[h_prop], {prefix="x", nl="", indent=" ", prefix_sep=" ", no_prefix_markup=true}) - if r["aspect"] ~= nil then + if r["aspect"] ~= nil and not video_res then append(s, format("%.2f:1", r["aspect"]), {prefix="", nl="", indent="", no_prefix_markup=true}) append(s, r["aspect-name"], {prefix="(", suffix=")", nl="", indent=" ", prefix_sep="", no_prefix_markup=true}) end + if r["sar"] ~= nil and video_res then + append(s, format("%.2f:1", r["sar"]), {prefix="", nl="", indent="", + no_prefix_markup=true}) + append(s, r["sar-name"], {prefix="(", suffix=")", nl="", indent=" ", + prefix_sep="", no_prefix_markup=true}) + end if r["s"] then append(s, format("%.2f", r["s"]), {prefix="(", suffix="x)", nl="", indent=o.prefix_sep, prefix_sep="", -- cgit v1.2.3