diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c index 13806a1ba82da61b9d53c7b0ef409626d23ddddc..18e4ae871a8d06adafc9acb51679c565d640da64 100644 --- a/modules/packetizer/h264.c +++ b/modules/packetizer/h264.c @@ -540,12 +540,12 @@ static void ResetOutputVariables( decoder_sys_t *p_sys ) p_sys->i_recovery_frame_cnt = UINT_MAX; } -static void PacketizeReset( void *p_private, bool b_broken ) +static void PacketizeReset( void *p_private, bool b_flush ) { decoder_t *p_dec = p_private; decoder_sys_t *p_sys = p_dec->p_sys; - if( b_broken || !p_sys->b_slice ) + if( b_flush || !p_sys->b_slice ) { DropStoredNAL( p_sys ); ResetOutputVariables( p_sys ); diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c index 8cba9a66b70deb5040496a16c89fa08097397d1d..f9b38fa8c6b026a8cf5057691de713f06f5d8683 100644 --- a/modules/packetizer/hevc.c +++ b/modules/packetizer/hevc.c @@ -348,10 +348,8 @@ static block_t *GetCc( decoder_t *p_dec, decoder_cc_desc_t *p_desc ) /**************************************************************************** * Packetizer Helpers ****************************************************************************/ -static void PacketizeReset(void *p_private, bool b_broken) +static void PacketizeReset(void *p_private, bool b_flush) { - VLC_UNUSED(b_broken); - decoder_t *p_dec = p_private; decoder_sys_t *p_sys = p_dec->p_sys; @@ -359,8 +357,11 @@ static void PacketizeReset(void *p_private, bool b_broken) if(p_out) block_ChainRelease(p_out); - p_sys->sets = MISSING; - p_sys->b_recovery_point = false; + if(b_flush) + { + p_sys->sets = MISSING; + p_sys->b_recovery_point = false; + } p_sys->b_need_ts = true; date_Set(&p_sys->dts, VLC_TICK_INVALID); } diff --git a/modules/packetizer/mjpeg.c b/modules/packetizer/mjpeg.c index 5f4e6ff8f3e4ce43044fed9aafcaf7ef36fa71e6..223f7e9c7cea04c72deed10ea40bd1d4612e1e51 100644 --- a/modules/packetizer/mjpeg.c +++ b/modules/packetizer/mjpeg.c @@ -80,9 +80,9 @@ static void PacketizeFlush( decoder_t *p_dec ) /***************************************************************************** * Helpers: *****************************************************************************/ -static void PacketizeReset( void *p_private, bool b_broken ) +static void PacketizeReset( void *p_private, bool b_flush ) { - VLC_UNUSED(b_broken); + VLC_UNUSED(b_flush); decoder_t *p_dec = p_private; decoder_sys_t *p_sys = p_dec->p_sys; diff --git a/modules/packetizer/mpeg4video.c b/modules/packetizer/mpeg4video.c index 4b67a8829c668de077bdcd7a584a1bba90acb2e3..927f71e82822f70303fb655c0f2af08f941866e6 100644 --- a/modules/packetizer/mpeg4video.c +++ b/modules/packetizer/mpeg4video.c @@ -204,12 +204,12 @@ static void PacketizeFlush( decoder_t *p_dec ) /***************************************************************************** * Helpers: *****************************************************************************/ -static void PacketizeReset( void *p_private, bool b_broken ) +static void PacketizeReset( void *p_private, bool b_flush ) { decoder_t *p_dec = p_private; decoder_sys_t *p_sys = p_dec->p_sys; - if( b_broken ) + if( b_flush ) { if( p_sys->p_frame ) block_ChainRelease( p_sys->p_frame ); diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c index 158f5cfd062df3884357ec47a5adf4c889a64979..ac8040f0d036fc26c6398f2320c1204a036d170d 100644 --- a/modules/packetizer/mpegvideo.c +++ b/modules/packetizer/mpegvideo.c @@ -351,9 +351,9 @@ static block_t *GetCc( decoder_t *p_dec, decoder_cc_desc_t *p_desc ) /***************************************************************************** * Helpers: *****************************************************************************/ -static void PacketizeReset( void *p_private, bool b_broken ) +static void PacketizeReset( void *p_private, bool b_flush ) { - VLC_UNUSED(b_broken); + VLC_UNUSED(b_flush); decoder_t *p_dec = p_private; decoder_sys_t *p_sys = p_dec->p_sys; diff --git a/modules/packetizer/packetizer_helper.h b/modules/packetizer/packetizer_helper.h index dece985b24fa8b594bd78e2eaecbde661ea4c484..c65c4e5911372f62086ab795f173f3f7534ef545 100644 --- a/modules/packetizer/packetizer_helper.h +++ b/modules/packetizer/packetizer_helper.h @@ -36,7 +36,7 @@ enum STATE_CUSTOM_FIRST, }; -typedef void (*packetizer_reset_t)( void *p_private, bool b_broken ); +typedef void (*packetizer_reset_t)( void *p_private, bool b_flush ); typedef block_t *(*packetizer_parse_t)( void *p_private, bool *pb_ts_used, block_t * ); typedef int (*packetizer_validate_t)( void *p_private, block_t * ); @@ -115,16 +115,10 @@ static inline block_t *packetizer_Packetize( packetizer_t *p_pack, block_t **pp_ if( p_drained ) return p_drained; - const bool b_broken = !!( p_block->i_flags&BLOCK_FLAG_CORRUPTED ); p_pack->i_state = STATE_NOSYNC; block_BytestreamEmpty( &p_pack->bytestream ); p_pack->i_offset = 0; - p_pack->pf_reset( p_pack->p_private, b_broken ); - if( b_broken ) - { - block_Release( p_block ); - return NULL; - } + p_pack->pf_reset( p_pack->p_private, false ); } if( p_block ) diff --git a/modules/packetizer/vc1.c b/modules/packetizer/vc1.c index 2d4fdf13d29c47efb0744c709291d41bc39b514e..e08ab034e8bc82454a46880f98168ada4e86eaaf 100644 --- a/modules/packetizer/vc1.c +++ b/modules/packetizer/vc1.c @@ -272,12 +272,12 @@ static void Flush( decoder_t *p_dec ) packetizer_Flush( &p_sys->packetizer ); } -static void PacketizeReset( void *p_private, bool b_broken ) +static void PacketizeReset( void *p_private, bool b_flush ) { decoder_t *p_dec = p_private; decoder_sys_t *p_sys = p_dec->p_sys; - if( b_broken ) + if( b_flush ) { if( p_sys->p_frame ) block_ChainRelease( p_sys->p_frame );