[vlc-commits] packetizer: h264: handle secondary drain
Francois Cartegnie
git at videolan.org
Wed Sep 25 21:46:53 CEST 2019
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Sep 25 11:25:16 2019 +0200| [691578d410deac8ad89f331df5bb34a5db661eba] | committer: Francois Cartegnie
packetizer: h264: handle secondary drain
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=691578d410deac8ad89f331df5bb34a5db661eba
---
modules/packetizer/h264.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index 27f26820ba..ea4d2f994b 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -144,6 +144,7 @@ static void PacketizeFlush( decoder_t * );
static void PacketizeReset( void *p_private, bool b_broken );
static block_t *PacketizeParse( void *p_private, bool *pb_ts_used, block_t * );
static int PacketizeValidate( void *p_private, block_t * );
+static block_t * PacketizeDrain( void *p_private );
static block_t *ParseNALBlock( decoder_t *, bool *pb_ts_used, block_t * );
@@ -337,7 +338,7 @@ static int Open( vlc_object_t *p_this )
packetizer_Init( &p_sys->packetizer,
p_h264_startcode, sizeof(p_h264_startcode), startcode_FindAnnexB,
p_h264_startcode, 1, 5,
- PacketizeReset, PacketizeParse, PacketizeValidate, NULL,
+ PacketizeReset, PacketizeParse, PacketizeValidate, PacketizeDrain,
p_dec );
p_sys->b_slice = false;
@@ -580,6 +581,24 @@ static int PacketizeValidate( void *p_private, block_t *p_au )
return VLC_SUCCESS;
}
+static block_t * PacketizeDrain( void *p_private )
+{
+ decoder_t *p_dec = p_private;
+ decoder_sys_t *p_sys = p_dec->p_sys;
+
+ if( !p_sys->b_slice )
+ return NULL;
+
+ block_t *p_out = OutputPicture( p_dec );
+ if( p_out && (p_out->i_flags & BLOCK_FLAG_DROP) )
+ {
+ block_Release( p_out );
+ p_out = NULL;
+ }
+
+ return p_out;
+}
+
/*****************************************************************************
* ParseNALBlock: parses annexB type NALs
* All p_frag blocks are required to start with 0 0 0 1 4-byte startcode
More information about the vlc-commits
mailing list