[vlc-commits] packetizer: mpegvideo: perform secondary drain
Francois Cartegnie
git at videolan.org
Fri Oct 11 17:28:37 CEST 2019
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Sep 26 11:02:35 2019 +0200| [94f9f09ec74c97bcbb0eb505631d244ad5f054d8] | committer: Francois Cartegnie
packetizer: mpegvideo: perform secondary drain
(cherry picked from commit 873a6bc6b274043791d4e1d92ac24fc165a9ba34)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=94f9f09ec74c97bcbb0eb505631d244ad5f054d8
---
modules/packetizer/mpegvideo.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c
index b1f04bcd72..f4f3be9a83 100644
--- a/modules/packetizer/mpegvideo.c
+++ b/modules/packetizer/mpegvideo.c
@@ -182,6 +182,7 @@ static block_t *GetCc( decoder_t *p_dec, decoder_cc_desc_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 *ParseMPEGBlock( decoder_t *, block_t * );
@@ -210,7 +211,7 @@ static int Open( vlc_object_t *p_this )
packetizer_Init( &p_sys->packetizer,
p_mp2v_startcode, sizeof(p_mp2v_startcode), startcode_FindAnnexB,
NULL, 0, 4,
- PacketizeReset, PacketizeParse, PacketizeValidate, NULL,
+ PacketizeReset, PacketizeParse, PacketizeValidate, PacketizeDrain,
p_dec );
p_sys->p_seq = NULL;
@@ -591,6 +592,23 @@ static block_t *PacketizeParse( void *p_private, bool *pb_ts_used, block_t *p_bl
return p_block;
}
+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_waiting_iframe || !p_sys->b_frame_slice )
+ return NULL;
+
+ block_t *p_out = OutputFrame( p_dec );
+ if( p_out )
+ {
+ p_out->i_flags |= p_sys->i_next_block_flags;
+ p_sys->i_next_block_flags = 0;
+ }
+
+ return p_out;
+}
static int PacketizeValidate( void *p_private, block_t *p_au )
{
More information about the vlc-commits
mailing list