[vlc-commits] codec: videotoolbox: don't override colorimetry set by the input

Thomas Guillem git at videolan.org
Wed Sep 13 11:35:15 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Sep 13 11:17:42 2017 +0200| [9ca9f99ba0c5548e8dc33ca3ce93cc4115897dea] | committer: Thomas Guillem

codec: videotoolbox: don't override colorimetry set by the input

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

 modules/codec/videotoolbox.m | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index aa56aae0f7..b665e15e19 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1164,10 +1164,21 @@ static int SetH264DecoderInfo(decoder_t *p_dec, CFMutableDictionaryRef extradata
     if (i_ret != VLC_SUCCESS)
         return i_ret;
 
-    hxxx_helper_get_colorimetry(&p_sys->hh, &p_dec->fmt_out.video.primaries,
-                                &p_dec->fmt_out.video.transfer,
-                                &p_dec->fmt_out.video.space,
-                                &p_dec->fmt_out.video.b_color_range_full);
+    video_color_primaries_t primaries;
+    video_transfer_func_t transfer;
+    video_color_space_t colorspace;
+    bool full_range;
+    if (hxxx_helper_get_colorimetry(&p_sys->hh, &primaries, &transfer,
+                                    &colorspace, &full_range) == VLC_SUCCESS
+      && primaries != COLOR_PRIMARIES_UNDEF && transfer != TRANSFER_FUNC_UNDEF
+      && colorspace != COLOR_SPACE_UNDEF)
+    {
+        p_dec->fmt_out.video.primaries = primaries;
+        p_dec->fmt_out.video.transfer = transfer;
+        p_dec->fmt_out.video.space = colorspace;
+        p_dec->fmt_out.video.b_color_range_full = full_range;
+    }
+
     p_dec->fmt_out.video.i_visible_width =
     p_dec->fmt_out.video.i_width = i_video_width;
     p_dec->fmt_out.video.i_visible_height =



More information about the vlc-commits mailing list