[vlc-commits] packetizer: hevc: don't overwrite demuxer values

Francois Cartegnie git at videolan.org
Tue Aug 2 20:45:54 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Aug  2 16:43:36 2016 +0200| [833de4e609c43e8b2fce0167e54a6e1262ceed23] | committer: Francois Cartegnie

packetizer: hevc: don't overwrite demuxer values

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

 modules/packetizer/hevc.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c
index 6597af2..e950763 100644
--- a/modules/packetizer/hevc.c
+++ b/modules/packetizer/hevc.c
@@ -470,17 +470,23 @@ static block_t * ParseAUHead(decoder_t *p_dec, uint8_t i_nal_type, block_t *p_na
             {
                 const hevc_sequence_parameter_set_t *p_sps;
                 if( i_nal_type == HEVC_NAL_SPS &&
-                   !p_dec->fmt_out.video.i_frame_rate_base &&
                    (p_sps = p_dec->p_sys->rgi_p_decsps[i_id]) )
                 {
-                    (void) hevc_get_frame_rate( p_sps, p_dec->p_sys->rgi_p_decvps,
-                                                &p_dec->fmt_out.video.i_frame_rate,
-                                                &p_dec->fmt_out.video.i_frame_rate_base );
-                    (void) hevc_get_colorimetry( p_sps,
-                                                 &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);
+                    if(!p_dec->fmt_out.video.i_frame_rate)
+                    {
+                        (void) hevc_get_frame_rate( p_sps, p_dec->p_sys->rgi_p_decvps,
+                                                    &p_dec->fmt_out.video.i_frame_rate,
+                                                    &p_dec->fmt_out.video.i_frame_rate_base );
+                    }
+
+                    if(p_dec->fmt_out.video.primaries == COLOR_PRIMARIES_UNDEF)
+                    {
+                        (void) hevc_get_colorimetry( p_sps,
+                                                     &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);
+                    }
                 }
             }
         }



More information about the vlc-commits mailing list