diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c index 547a1d337e8da838cddd3612280d6b76fee26a8d..4c97b89884bcbd09b6f48b55fc685cf98782d2a0 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 * ); @@ -211,7 +212,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; @@ -603,6 +604,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 ) {