summaryrefslogtreecommitdiffstats
path: root/player/lua
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2023-11-10 23:57:18 -0500
committerDudemanguy <random342@airmail.cc>2023-11-14 15:00:23 +0000
commit6f17a5efe3929dc1a330471382137a5fcc075f12 (patch)
tree014c04f39d5b952605b6f054d0d6b9ceec919445 /player/lua
parent4ab4a888892192caeab64b7efbddce2c8881e095 (diff)
downloadmpv-6f17a5efe3929dc1a330471382137a5fcc075f12.tar.bz2
mpv-6f17a5efe3929dc1a330471382137a5fcc075f12.tar.xz
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.
Diffstat (limited to 'player/lua')
-rw-r--r--player/lua/stats.lua8
1 files changed, 7 insertions, 1 deletions
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="",