[vlc-devel] [PATCH 2/7] opengl: fix value scale on mastering metadata

Niklas Haas vlc at haasn.xyz
Mon Oct 1 16:51:47 CEST 2018


From: Niklas Haas <git at haasn.xyz>

This is not in cd/m² scale, but in a scale where a value of 10000.0
means 1 cd/m². So we have to divide out this factor.
---
 modules/video_output/opengl/fragment_shaders.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/video_output/opengl/fragment_shaders.c b/modules/video_output/opengl/fragment_shaders.c
index 9308857027..e117122b93 100644
--- a/modules/video_output/opengl/fragment_shaders.c
+++ b/modules/video_output/opengl/fragment_shaders.c
@@ -537,7 +537,7 @@ static struct pl_color_space pl_color_space_from_video_format(const video_format
     // As a fallback value for the signal peak, we can also use the mastering
     // metadata's luminance information
     if (!sig_peak)
-        sig_peak = fmt->mastering.max_luminance / PL_COLOR_REF_WHITE;
+        sig_peak = fmt->mastering.max_luminance / (10000.0 * PL_COLOR_REF_WHITE);
 
     // Sanitize the sig_peak/sig_avg, because of buggy or low quality tagging
     // that's sadly common in lots of typical sources
-- 
2.19.0



More information about the vlc-devel mailing list