[vlc-commits] packetizer: h264: keep container color profile

Francois Cartegnie git at videolan.org
Mon Dec 26 19:11:27 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Dec 26 18:33:53 2016 +0100| [81b08e0c7987b80c9377bede27849ff3857bfa01] | committer: Francois Cartegnie

packetizer: h264: keep container color profile

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

 modules/packetizer/h264.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index 8e8b1d5..1b455af 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -766,13 +766,16 @@ static void PutSPS( decoder_t *p_dec, block_t *p_frag )
             p_dec->fmt_out.video.i_frame_rate_base = p_sps->vui.i_num_units_in_tick;
             p_dec->fmt_out.video.i_frame_rate = p_sps->vui.i_time_scale >> 1 /* num_clock_ts == 2 */;
         }
-        p_dec->fmt_out.video.primaries =
-            hxxx_colour_primaries_to_vlc( p_sps->vui.colour.i_colour_primaries );
-        p_dec->fmt_out.video.transfer =
-            hxxx_transfer_characteristics_to_vlc( p_sps->vui.colour.i_transfer_characteristics );
-        p_dec->fmt_out.video.space =
-            hxxx_matrix_coeffs_to_vlc( p_sps->vui.colour.i_matrix_coefficients );
-        p_dec->fmt_out.video.b_color_range_full = p_sps->vui.colour.b_full_range;
+        if( p_dec->fmt_out.video.primaries == COLOR_PRIMARIES_UNDEF )
+        {
+            p_dec->fmt_out.video.primaries =
+                hxxx_colour_primaries_to_vlc( p_sps->vui.colour.i_colour_primaries );
+            p_dec->fmt_out.video.transfer =
+                hxxx_transfer_characteristics_to_vlc( p_sps->vui.colour.i_transfer_characteristics );
+            p_dec->fmt_out.video.space =
+                hxxx_matrix_coeffs_to_vlc( p_sps->vui.colour.i_matrix_coefficients );
+            p_dec->fmt_out.video.b_color_range_full = p_sps->vui.colour.b_full_range;
+        }
     }
     /* We have a new SPS */
     if( !p_sys->b_sps )



More information about the vlc-commits mailing list