[vlc-devel] [PATCH 4/4] es: assume the color range is full for YUV sources when unknown

Steve Lhomme robux4 at ycbcr.xyz
Thu Dec 13 10:02:43 CET 2018


This is done when we need to guess the best pick for all color space values.
---
 include/vlc_es.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index 9f0a6b040f..217c921357 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -455,6 +455,14 @@ static inline void video_format_AdjustColorSpace( video_format_t *p_fmt )
         else
             p_fmt->space = COLOR_SPACE_BT601;
     }
+
+    if ( p_fmt->color_range == COLOR_RANGE_UNDEF )
+    {
+        if ( vlc_fourcc_IsYUV(p_fmt->i_chroma) )
+            p_fmt->color_range = COLOR_RANGE_LIMITED;
+        else
+            p_fmt->color_range = COLOR_RANGE_FULL;
+    }
 }
 
 /**
-- 
2.17.1



More information about the vlc-devel mailing list