summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-08-31 18:48:31 +0200
committerNiklas Haas <github-daiK1o@haasn.dev>2023-10-14 12:30:46 +0200
commit499a9d90aba79ba2fd6fb615aea134e45e0a2e29 (patch)
tree4f51fcfba44dfba1e4f0339696a350fdd5cdd77e
parentf2f33ac1e8516baea721564d712266c0f23f19a5 (diff)
downloadmpv-499a9d90aba79ba2fd6fb615aea134e45e0a2e29.tar.bz2
mpv-499a9d90aba79ba2fd6fb615aea134e45e0a2e29.tar.xz
stats.lua: show HDR meta if not equal to 203
SDR white (203) is indeed not interesting, but anything else, even if lower is.
-rw-r--r--player/lua/stats.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/player/lua/stats.lua b/player/lua/stats.lua
index 3cb8a7599a..2a2efc51ed 100644
--- a/player/lua/stats.lua
+++ b/player/lua/stats.lua
@@ -741,19 +741,22 @@ local function append_hdr(s, hdr, video_out)
return
end
+ local function should_show(val)
+ return val and val ~= 203 and val > 0
+ end
+
-- If we are printing video out parameters it is just display, not mastering
local display_prefix = video_out and "Display:" or "Mastering display:"
- if (hdr["max-cll"] and hdr["max-cll"] > 203) or
- hdr["max-luma"] and hdr["max-luma"] > 203 then
+ if should_show(hdr["max-cll"]) or should_show(hdr["max-luma"]) then
append(s, "", {prefix="HDR10:"})
- if hdr["min-luma"] and hdr["max-luma"] and hdr["max-luma"] > 203 then
+ if hdr["min-luma"] and should_show(hdr["max-luma"]) then
-- libplacebo uses close to zero values as "defined zero"
hdr["min-luma"] = hdr["min-luma"] <= 1e-6 and 0 or hdr["min-luma"]
append(s, format("%.2g / %.0f", hdr["min-luma"], hdr["max-luma"]),
{prefix=display_prefix, suffix=" cd/m²", nl=""})
end
- if hdr["max-cll"] and hdr["max-cll"] > 203 then
+ if should_show(hdr["max-cll"]) then
append(s, hdr["max-cll"], {prefix="maxCLL:", suffix=" cd/m²", nl=""})
end
if hdr["max-fall"] and hdr["max-fall"] > 0 then