vlc/vlc-3.0 | branch: master | Steve Lhomme <[email protected]> | Mon Jun  3 
13:23:54 2019 +0200| [b4e6372652912b96558eda4f158efb9b60f1ca2b] | committer: 
Steve Lhomme

image: use the colorimetry parameters from the source when converting

(cherry picked from commit 282ae08400653615bbb90c0e5f75915991869fd7)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=b4e6372652912b96558eda4f158efb9b60f1ca2b
---

 src/misc/image.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/misc/image.c b/src/misc/image.c
index 6ea0e11bbd..ee51aa01e3 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -212,6 +212,12 @@ static picture_t *ImageRead( image_handler_t *p_image, 
block_t *p_block,
         p_fmt_out->i_visible_width = p_fmt_out->i_width;
     if( !p_fmt_out->i_visible_height )
         p_fmt_out->i_visible_height = p_fmt_out->i_height;
+    if( p_fmt_out->transfer == TRANSFER_FUNC_UNDEF )
+        p_fmt_out->transfer = p_image->p_dec->fmt_out.video.transfer;
+    if( p_fmt_out->primaries == COLOR_PRIMARIES_UNDEF )
+        p_fmt_out->primaries = p_image->p_dec->fmt_out.video.primaries;
+    if( p_fmt_out->space == COLOR_SPACE_UNDEF )
+        p_fmt_out->space = p_image->p_dec->fmt_out.video.space;
 
     /* Check if we need chroma conversion or resizing */
     if( p_image->p_dec->fmt_out.video.i_chroma != p_fmt_out->i_chroma ||

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to