Commit a901a788 authored by Ilkka Ollakka's avatar Ilkka Ollakka

packetizer: don't drop blocks with DISCONTINUITY

Do not drop blocks with BLOCK_FLAG_DISCONTINUITY, but do drop blocks with BLOCK_FLAG_CORRUPTED.
Signed-off-by: Jean-Paul Saman's avatarJean-Paul Saman <jpsaman@videolan.org>
parent 2b57b9ef
......@@ -139,7 +139,7 @@ static block_t *Packetize ( decoder_t *p_dec, block_t **pp_block )
if( pp_block == NULL || *pp_block == NULL )
return NULL;
if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
if( (*pp_block)->i_flags&(BLOCK_FLAG_CORRUPTED) )
{
block_Release( *pp_block );
return NULL;
......
......@@ -144,7 +144,7 @@ static block_t *Packetize ( decoder_t *p_dec, block_t **pp_block )
if( pp_block == NULL || *pp_block == NULL )
return NULL;
if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
if( (*pp_block)->i_flags&(BLOCK_FLAG_CORRUPTED) )
{
block_Release( *pp_block );
return NULL;
......@@ -186,7 +186,7 @@ static block_t *PacketizeSub( decoder_t *p_dec, block_t **pp_block )
if( pp_block == NULL || *pp_block == NULL )
return NULL;
if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
if( (*pp_block)->i_flags&(BLOCK_FLAG_CORRUPTED) )
{
block_Release( *pp_block );
return NULL;
......
......@@ -519,12 +519,12 @@ static block_t *Packetize(decoder_t *p_dec, block_t **pp_block)
in = *pp_block;
if (in->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED)) {
p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty(&p_sys->bytestream);
if (in->i_flags&BLOCK_FLAG_CORRUPTED) {
p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty(&p_sys->bytestream);
block_Release(*pp_block);
return NULL;
}
block_Release(*pp_block);
return NULL;
}
}
......
......@@ -420,7 +420,7 @@ static block_t *PacketizeAVC1( decoder_t *p_dec, block_t **pp_block )
if( !pp_block || !*pp_block )
return NULL;
if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
if( (*pp_block)->i_flags&(BLOCK_FLAG_CORRUPTED) )
{
block_Release( *pp_block );
return NULL;
......
......@@ -153,15 +153,15 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
/* */
if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{
if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
p_sys->b_mlp = false;
p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty( &p_sys->bytestream );
date_Set( &p_sys->end_date, 0 );
if( (*pp_block)->i_flags&(BLOCK_FLAG_CORRUPTED) )
{
p_sys->b_mlp = false;
p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty( &p_sys->bytestream );
block_Release( *pp_block );
return NULL;
}
date_Set( &p_sys->end_date, 0 );
block_Release( *pp_block );
return NULL;
}
if( !date_Get( &p_sys->end_date ) && !(*pp_block)->i_pts )
......
......@@ -299,10 +299,12 @@ static block_t *PacketizeRawBlock(decoder_t *p_dec, block_t **pp_block)
if (!pp_block || !*pp_block)
return NULL;
if ((*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED)) {
if ((*pp_block)->i_flags & (BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED)) {
date_Set(&p_sys->end_date, 0);
block_Release(*pp_block);
return NULL;
if ((*pp_block)->i_flags&(BLOCK_FLAG_CORRUPTED)) {
block_Release(*pp_block);
return NULL;
}
}
p_block = *pp_block;
......@@ -942,14 +944,14 @@ static block_t *PacketizeStreamBlock(decoder_t *p_dec, block_t **pp_block)
if (!pp_block || !*pp_block)
return NULL;
if ((*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED)) {
if ((*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED) {
p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty(&p_sys->bytestream);
if ((*pp_block)->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED)) {
p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty(&p_sys->bytestream);
date_Set(&p_sys->end_date, VLC_TS_INVALID);
if ((*pp_block)->i_flags & BLOCK_FLAG_CORRUPTED) {
block_Release(*pp_block);
return NULL;
}
date_Set(&p_sys->end_date, 0);
block_Release(*pp_block);
return NULL;
}
if (!date_Get(&p_sys->end_date) && (*pp_block)->i_pts <= VLC_TS_INVALID) {
......
......@@ -101,16 +101,15 @@ static inline block_t *packetizer_Packetize( packetizer_t *p_pack, block_t **pp_
if( unlikely( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) ) )
{
const bool b_broken = ( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED ) != 0;
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 )
{
p_pack->i_state = STATE_NOSYNC;
block_BytestreamEmpty( &p_pack->bytestream );
p_pack->i_offset = 0;
block_Release( *pp_block );
return NULL;
}
p_pack->pf_reset( p_pack->p_private, b_broken );
block_Release( *pp_block );
return NULL;
}
block_BytestreamPush( &p_pack->bytestream, *pp_block );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment