[vlc-commits] packetizer: helper: handle AU_END flag

Francois Cartegnie git at videolan.org
Thu Mar 7 17:29:28 CET 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Aug 28 23:51:42 2018 +0200| [81dfea36cc1566c2af21b5faef1af384449c19bf] | committer: Francois Cartegnie

packetizer: helper: handle AU_END flag

Using the AU_END hint, we don't need to wait the
next sync code as we know that last block is complete.
Helps cutting 1frame duration, which really helps in low fps.

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

 modules/packetizer/packetizer_helper.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/packetizer/packetizer_helper.h b/modules/packetizer/packetizer_helper.h
index 69dad89d21..d9e43fa27e 100644
--- a/modules/packetizer/packetizer_helper.h
+++ b/modules/packetizer/packetizer_helper.h
@@ -171,7 +171,8 @@ static inline block_t *packetizer_Packetize( packetizer_t *p_pack, block_t **pp_
                                        NULL, &p_pack->i_offset, NULL );
                 p_pack->i_offset -= p_pack->bytestream.i_block_offset;
 
-                if( p_pack->i_offset <= (size_t)p_pack->i_startcode )
+                if( p_pack->i_offset <= (size_t)p_pack->i_startcode &&
+                    (p_pack->bytestream.p_block->i_flags & BLOCK_FLAG_AU_END) == 0 )
                     return NULL;
             }
 
@@ -184,6 +185,13 @@ static inline block_t *packetizer_Packetize( packetizer_t *p_pack, block_t **pp_
             p_pic->i_pts = p_block_bytestream->i_pts;
             p_pic->i_dts = p_block_bytestream->i_dts;
 
+            /* Do not wait for next sync code if notified block ends AU */
+            if( (p_block_bytestream->i_flags & BLOCK_FLAG_AU_END) &&
+                 p_block_bytestream->i_buffer == p_pack->i_offset )
+            {
+                p_pic->i_flags |= BLOCK_FLAG_AU_END;
+            }
+
             block_GetBytes( &p_pack->bytestream, &p_pic->p_buffer[p_pack->i_au_prepend],
                             p_pic->i_buffer - p_pack->i_au_prepend );
             if( p_pack->i_au_prepend > 0 )



More information about the vlc-commits mailing list