[vlc-commits] packetizer: h264: set EOS flag
Francois Cartegnie
git at videolan.org
Tue Jun 13 09:14:26 CEST 2017
vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Jun 12 23:40:51 2017 +0200| [994dd92d68c447d7a5519077ceef74865a552ba6] | committer: Francois Cartegnie
packetizer: h264: set EOS flag
bp of bcb8f9046ffb245a9cbe47f039da346eab9287c2
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=994dd92d68c447d7a5519077ceef74865a552ba6
---
modules/packetizer/h264.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index 7e29b8683e..ded600fb94 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -142,8 +142,10 @@ enum nal_unit_type_e
NAL_SEI = 6, /* ref_idc == 0 */
NAL_SPS = 7,
NAL_PPS = 8,
- NAL_AU_DELIMITER= 9
+ NAL_AU_DELIMITER= 9,
/* ref_idc == 0 for 6,9,10,11,12 */
+ NAL_END_OF_SEQ = 10,
+ NAL_END_OF_STREAM = 11,
};
#define BLOCK_FLAG_PRIVATE_AUD (1 << BLOCK_FLAG_PRIVATE_SHIFT)
@@ -661,6 +663,22 @@ static block_t *ParseNALBlock( decoder_t *p_dec, bool *pb_ts_used, block_t *p_fr
/* Do not append the PPS because we will insert it on keyframes */
p_frag = NULL;
}
+ else if( i_nal_type == NAL_END_OF_SEQ || i_nal_type == NAL_END_OF_STREAM )
+ {
+ /* Force early output */
+ if( p_frag )
+ {
+ block_ChainAppend( &p_sys->p_frame, p_frag );
+ p_frag = NULL;
+ }
+
+ if( p_sys->b_slice )
+ {
+ p_pic = OutputPicture( p_dec );
+ if( p_pic ) /* set flag for menus / stills */
+ p_pic->i_flags |= BLOCK_FLAG_END_OF_SEQUENCE;
+ }
+ }
else if( i_nal_type == NAL_AU_DELIMITER ||
i_nal_type == NAL_SEI ||
( i_nal_type >= 13 && i_nal_type <= 18 ) )
More information about the vlc-commits
mailing list