[vlc-commits] [Git][videolan/vlc][master] packetizer: hevc: fix xps insertion on recovery point

François Cartegnie (@fcartegnie) gitlab at videolan.org
Tue Mar 5 19:19:09 UTC 2024



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
a20f72c6 by François Cartegnie at 2024-03-05T18:54:43+00:00
packetizer: hevc: fix xps insertion on recovery point

Was not inserted if there's no pre-frame NAL units

- - - - -


1 changed file:

- modules/packetizer/hevc.c


Changes:

=====================================
modules/packetizer/hevc.c
=====================================
@@ -134,30 +134,37 @@ static inline void InitQueue( block_t **pp_head, block_t ***ppp_tail )
 static block_t * OutputQueues(decoder_sys_t *p_sys, bool b_valid)
 {
     block_t *p_output = NULL;
+    block_t *p_xps = NULL;
     block_t **pp_output_last = &p_output;
     uint32_t i_flags = 0; /* Because block_ChainGather does not merge flags or times */
 
+    if(p_sys->b_recovery_point && p_sys->sets != SENT)
+        p_xps = GetXPSCopy(p_sys);
+
     if(p_sys->pre.p_chain)
     {
         i_flags |= p_sys->pre.p_chain->i_flags;
-        if(p_sys->b_recovery_point && p_sys->sets != SENT)
+
+        if(p_sys->pre.p_chain->i_buffer >= 5 &&
+            hevc_getNALType(&p_sys->pre.p_chain->p_buffer[4]) == HEVC_NAL_AUD)
         {
-            if(p_sys->pre.p_chain->i_buffer >= 5 &&
-               hevc_getNALType(&p_sys->pre.p_chain->p_buffer[4]) == HEVC_NAL_AUD)
-            {
-                block_t *p_au = p_sys->pre.p_chain;
-                p_sys->pre.p_chain = p_sys->pre.p_chain->p_next;
-                p_au->p_next = NULL;
-                block_ChainLastAppend(&pp_output_last, p_au);
-            }
-            block_t *p_xps = GetXPSCopy(p_sys);
-            if(p_xps)
-                block_ChainLastAppend(&pp_output_last, p_xps);
+            block_t *p_au = p_sys->pre.p_chain;
+            p_sys->pre.p_chain = p_sys->pre.p_chain->p_next;
+            p_au->p_next = NULL;
+            block_ChainLastAppend(&pp_output_last, p_au);
         }
+
+        if(p_xps)
+            block_ChainLastAppend(&pp_output_last, p_xps);
+
         if(p_sys->pre.p_chain)
             block_ChainLastAppend(&pp_output_last, p_sys->pre.p_chain);
         INITQ(pre);
     }
+    else if(p_xps)
+    {
+        block_ChainLastAppend(&pp_output_last, p_xps);
+    }
 
     if(p_sys->frame.p_chain)
     {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a20f72c674c1c0c9b012790ed8b149c0532881c7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a20f72c674c1c0c9b012790ed8b149c0532881c7
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list