[vlc-commits] packetizer: h264: optmize sps/pps blocks chaining

Francois Cartegnie git at videolan.org
Wed Dec 23 16:06:25 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Dec 23 12:12:33 2015 +0100| [1d9cfa88e4505b442c8e4d361e9d83a45e37a7a4] | committer: Francois Cartegnie

packetizer: h264: optmize sps/pps blocks chaining

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

 modules/packetizer/h264.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index 88e30d7..9c9a2ee 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -595,23 +595,22 @@ static block_t *OutputPicture( decoder_t *p_dec )
         }
 
         block_t *p_list = NULL;
+        block_t **pp_list_tail = &p_list;
         for( int i = 0; i < H264_SPS_MAX && (b_sps_pps_i || p_sys->b_frame_sps); i++ )
         {
             if( p_sys->pp_sps[i] )
-                block_ChainAppend( &p_list, block_Duplicate( p_sys->pp_sps[i] ) );
+                block_ChainLastAppend( &pp_list_tail, block_Duplicate( p_sys->pp_sps[i] ) );
         }
         for( int i = 0; i < H264_PPS_MAX && (b_sps_pps_i || p_sys->b_frame_pps); i++ )
         {
             if( p_sys->pp_pps[i] )
-                block_ChainAppend( &p_list, block_Duplicate( p_sys->pp_pps[i] ) );
+                block_ChainLastAppend( &pp_list_tail, block_Duplicate( p_sys->pp_pps[i] ) );
         }
         if( b_sps_pps_i && p_list )
             p_sys->b_header = true;
 
-        if( p_head )
-            p_head->p_next = p_list;
-        else
-            p_head = p_list;
+        if( p_list )
+            block_ChainAppend( &p_head, p_list );
 
         if( p_sys->p_frame )
             block_ChainAppend( &p_head, p_sys->p_frame );



More information about the vlc-commits mailing list