From 499a9d90aba79ba2fd6fb615aea134e45e0a2e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Thu, 31 Aug 2023 18:48:31 +0200 Subject: stats.lua: show HDR meta if not equal to 203 SDR white (203) is indeed not interesting, but anything else, even if lower is. --- player/lua/stats.lua | 11 +++++++---- 1 file 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 -- cgit v1.2.3