[vlc-commits] packetizer: hevc: fix storage and check of temporal id

Francois Cartegnie git at videolan.org
Thu Dec 14 14:08:51 CET 2017


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Dec 14 13:48:17 2017 +0100| [ad7db4bc887c743613ea687a45d6ca2a6a2e2c7e] | committer: Francois Cartegnie

packetizer: hevc: fix storage and check of temporal id

(cherry picked from commit db383e8bcc94f4497e43554813797edc1192eeaf)

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

 modules/packetizer/hevc_nal.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/packetizer/hevc_nal.c b/modules/packetizer/hevc_nal.c
index 66d568c324..4afb1c6573 100644
--- a/modules/packetizer/hevc_nal.c
+++ b/modules/packetizer/hevc_nal.c
@@ -309,7 +309,7 @@ struct hevc_slice_segment_header_t
 {
     nal_u6_t nal_type;
     nal_u6_t nuh_layer_id;
-    nal_u3_t temporal_id;
+    nal_u3_t temporal_id_plus1;
     nal_u1_t first_slice_segment_in_pic_flag;
     nal_u1_t no_output_of_prior_pics_flag;
     nal_ue_t slice_pic_parameter_set_id;
@@ -1259,8 +1259,8 @@ hevc_slice_segment_header_t * hevc_decode_slice_header( const uint8_t *p_buf, si
         bs_skip( &bs, 1 );
         p_sh->nal_type = bs_read( &bs, 6 );
         p_sh->nuh_layer_id = bs_read( &bs, 6 );
-        p_sh->temporal_id = bs_read( &bs, 3 );
-        if( p_sh->nuh_layer_id > 62 ||
+        p_sh->temporal_id_plus1 = bs_read( &bs, 3 );
+        if( p_sh->nuh_layer_id > 62 || p_sh->temporal_id_plus1 == 0 ||
            !hevc_parse_slice_segment_header_rbsp( &bs, get_matchedxps, priv, p_sh ) )
         {
             hevc_rbsp_release_slice_header( p_sh );
@@ -1505,7 +1505,7 @@ int hevc_compute_picture_order_count( const hevc_sequence_parameter_set_t *p_sps
     }
 
     /* Set prevTid0Pic for next pic */
-    if( p_slice->temporal_id == 0 &&
+    if( p_slice->temporal_id_plus1 == 1 &&
        !( ( p_slice->nal_type <= HEVC_NAL_RSV_VCL_N14 && p_slice->nal_type % 2 == 0 /* SLNR */ ) ||
           ( p_slice->nal_type >= HEVC_NAL_RADL_N && p_slice->nal_type <= HEVC_NAL_RASL_R ) /* RADL or RASL */ ) )
     {



More information about the vlc-commits mailing list