mirror of https://github.com/mpv-player/mpv
stats: fix crash when aspect ratio is unavailable
When switching between files it's possible that r["aspect"] returns nil, resulting in a crash.
This commit is contained in:
parent
b238897614
commit
359261c50c
|
@ -545,7 +545,9 @@ local function add_video(s)
|
|||
append(s, r["h"], {prefix="x", nl="", indent=" ", prefix_sep=" ", no_prefix_markup=true})
|
||||
end
|
||||
append_property(s, "current-window-scale", {prefix="Window Scale:"})
|
||||
append(s, format("%.2f", r["aspect"]), {prefix="Aspect Ratio:"})
|
||||
if r["aspect"] ~= nil then
|
||||
append(s, format("%.2f", r["aspect"]), {prefix="Aspect Ratio:"})
|
||||
end
|
||||
append(s, r["pixelformat"], {prefix="Pixel Format:"})
|
||||
|
||||
-- Group these together to save vertical space
|
||||
|
|
Loading…
Reference in New Issue