mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
4ab4a88889
commit
6f17a5efe3
|
@ -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="",
|
||||
|
|
Loading…
Reference in New Issue