Commit d0c57481 authored by Ilkka Ollakka's avatar Ilkka Ollakka

Revert "codec: don't drop blocks marked BLOCK_FLAG_DISCONTINUITY"

This reverts commit 48a867c7.

Revert for futher checking
parent 6d888d8c
......@@ -174,24 +174,26 @@ static block_t *DecodeBlock( 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) )
{
date_Set( &p_sys->end_date, 0 );
if( (*pp_block)->i_flags & BLOCK_FLAG_CORRUPTED )
if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
{
p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty( &p_sys->bytestream );
block_Release( *pp_block );
*pp_block = NULL;
return NULL;
}
date_Set( &p_sys->end_date, 0 );
block_Release( *pp_block );
return NULL;
}
if( (*pp_block)->i_flags & BLOCK_FLAG_DISCONTINUITY )
{
date_Set( &p_sys->end_date, 0 );
}
if( !date_Get( &p_sys->end_date ) && (*pp_block)->i_pts <= VLC_TS_INVALID)
{
/* We've just started the stream, wait for the first PTS. */
block_Release( *pp_block );
*pp_block = NULL;
return NULL;
}
......
......@@ -276,16 +276,6 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( !pp_block || !*pp_block ) return NULL;
p_block = *pp_block;
*pp_block = NULL; /* So the packet doesn't get re-sent */
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
block_Release( p_block );
return NULL;
}
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
date_Set( &p_sys->end_date, 0 );
if( p_block->i_pts > VLC_TS_INVALID &&
p_block->i_pts != date_Get( &p_sys->end_date ) )
......
......@@ -310,15 +310,6 @@ static block_t *Parse( decoder_t *p_dec, int *pi_frame_length, int *pi_bits,
p_block = *pp_block;
*pp_block = NULL; /* So the packet doesn't get re-sent */
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
block_Release( p_block );
return NULL;
}
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
date_Set( &p_sys->end_date, 0 );
/* Date management */
if( p_block->i_pts > VLC_TS_INVALID &&
p_block->i_pts != date_Get( &p_sys->end_date ) )
......@@ -380,3 +371,4 @@ static block_t *Parse( decoder_t *p_dec, int *pi_frame_length, int *pi_bits,
*pi_bits = i_bits;
return p_block;
}
......@@ -314,12 +314,6 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL;
*pp_block = NULL;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
goto skip;
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
date_Set( &p_sys->end_date, 0 );
if( p_block->i_pts > VLC_TS_INVALID &&
p_block->i_pts != date_Get( &p_sys->end_date ) )
{
......
......@@ -173,12 +173,6 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
}
p_block = *pp_block;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
block_Release( p_block );
return NULL;
}
arib_parser_t *p_parser = arib_get_parser( p_sys->p_arib_instance );
arib_decoder_t *p_decoder = arib_get_decoder( p_sys->p_arib_instance );
if ( p_parser && p_decoder )
......
......@@ -261,7 +261,7 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
if( p_sys->b_delayed_open )
goto end;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
if( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) )
{
avcodec_flush_buffers( ctx );
date_Set( &p_sys->end_date, VLC_TS_INVALID );
......@@ -272,9 +272,9 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
goto end;
}
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
{
avcodec_flush_buffers( ctx );
date_Set( &p_sys->end_date, VLC_TS_INVALID );
}
......
......@@ -124,13 +124,13 @@ static subpicture_t *DecodeSubtitle(decoder_t *dec, block_t **block_ptr)
block_t *block = *block_ptr;
if (block->i_flags & (BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED)) {
if (block->i_flags & BLOCK_FLAG_CORRUPTED) {
avcodec_flush_buffers(sys->p_context);
block_Release(block);
return NULL;
}
if (block->i_flags & (BLOCK_FLAG_CORRUPTED)) {
block_Release(block);
avcodec_flush_buffers(sys->p_context);
return NULL;
}
if (block->i_flags & BLOCK_FLAG_DISCONTINUITY)
avcodec_flush_buffers(sys->p_context);
if (block->i_buffer <= 0) {
block_Release(block);
......
......@@ -516,13 +516,12 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
p_sys->i_pts = VLC_TS_INVALID; /* To make sure we recover properly */
p_sys->i_late_frames = 0;
#if 0
/* NOTE: data is good only the timeline changed so do not flush decoder */
post_mt( p_sys );
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
avcodec_flush_buffers( p_context );
wait_mt( p_sys );
#endif
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
block_Release( p_block );
......
......@@ -96,13 +96,18 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
BPGImageInfo img_info;
if( !pp_block || !*pp_block )
{
return NULL;
}
p_block = *pp_block;
*pp_block = NULL;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
goto error;
{
block_Release(p_block);
*pp_block = NULL;
return NULL;
}
/* Decode picture */
......@@ -158,10 +163,15 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_pic->date = p_block->i_pts > VLC_TS_INVALID ? p_block->i_pts : p_block->i_dts;
block_Release( p_block );
*pp_block = NULL;
return p_pic;
error:
block_Release( p_block );
*pp_block = NULL;
return NULL;
}
......
......@@ -143,7 +143,7 @@ static picture_t *Decode( decoder_t *p_dec, block_t **pp_block )
return NULL;
p_block = *pp_block;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
if( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) )
{
p_sys->i_packet = 0;
goto exit;
......@@ -170,8 +170,7 @@ static picture_t *Decode( decoder_t *p_dec, block_t **pp_block )
}
exit:
block_Release( p_block );
*pp_block = NULL;
block_Release( p_block ); *pp_block = NULL;
return p_pic;
}
......
......@@ -443,9 +443,10 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block;
if( p_block )
{
if( ( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) ) == 0 )
if( ( p_block->i_flags&(BLOCK_FLAG_CORRUPTED) ) == 0 )
{
/* Valid input block, so we can send to HW to decode */
BC_STATUS status = BC_FUNC_PSYS(DtsProcInput)( p_sys->bcm_handle,
p_block->p_buffer,
p_block->i_buffer,
......
......@@ -169,12 +169,6 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block;
*pp_block = NULL;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
block_Release( p_block );
return NULL;
}
if( !(p_spu = Reassemble( p_dec, p_block )) ) return NULL;
/* Parse and decode */
......
......@@ -127,7 +127,6 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( !pp_block || !*pp_block ) return NULL;
p_block = *pp_block;
*pp_block = NULL;
if( stream != NULL
&& p_block->i_buffer > 0
......
......@@ -174,18 +174,16 @@ static block_t *DecodeBlock( 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 );
date_Set( &p_sys->end_date, 0 );
if( (*pp_block)->i_flags & BLOCK_FLAG_CORRUPTED )
{
p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty( &p_sys->bytestream );
block_Release( *pp_block );
*pp_block = NULL;
return NULL;
}
block_Release( *pp_block );
return NULL;
}
if( (*pp_block)->i_flags & BLOCK_FLAG_DISCONTINUITY )
date_Set( &p_sys->end_date, 0 );
if( !date_Get( &p_sys->end_date ) && (*pp_block)->i_pts <= VLC_TS_INVALID )
{
......
......@@ -402,19 +402,9 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block;
*pp_block = NULL;
if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED) )
{
p_sys->i_pts = VLC_TS_INVALID;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
block_Release( p_block );
return NULL;
}
}
/* configure for SD res in case DDS is not present */
/* a change of PTS is a good indication we must get a new DDS */
if( p_sys->i_pts != p_block->i_pts )
if (p_sys->i_pts != p_block->i_pts)
default_dds_init( p_dec );
p_sys->i_pts = p_block->i_pts;
......
......@@ -209,16 +209,11 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( !pp_block || !*pp_block ) return NULL;
p_block = *pp_block;
*pp_block = NULL;
if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED) )
if( p_block->i_flags&(BLOCK_FLAG_CORRUPTED) )
{
date_Set( &p_sys->date, 0 );
if( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) )
{
block_Release( p_block );
return NULL;
}
block_Release( p_block );
return NULL;
}
/* Remove ADTS header if we have decoder specific config */
......
......@@ -500,15 +500,10 @@ static block_t *DecodeBlock( 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) )
{
date_Set( &p_sys->end_date, 0 );
if( (*pp_block)->i_flags & BLOCK_FLAG_CORRUPTED )
{
block_Release( *pp_block );
*pp_block = NULL;
return NULL;
}
block_Release( *pp_block );
return NULL;
}
if( !p_sys->b_stream_info )
......
......@@ -208,17 +208,12 @@ static block_t *DecodeBlock (decoder_t *p_dec, block_t **pp_block)
if (p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED))
{
date_Set (&p_sys->end_date, VLC_TS_INVALID);
date_Set (&p_sys->end_date, 0);
//fluid_synth_system_reset (p_sys->synth);
fluid_synth_program_reset (p_sys->synth);
for (unsigned channel = 0; channel < 16; channel++)
for (unsigned note = 0; note < 128; note++)
fluid_synth_noteoff (p_sys->synth, channel, note);
if (p_block->i_flags & BLOCK_FLAG_CORRUPTED)
{
block_Release(p_block);
return NULL;
}
}
if (p_block->i_pts > VLC_TS_INVALID && !date_Get (&p_sys->end_date))
......
......@@ -219,19 +219,9 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( pp_block == NULL )
return NULL;
block_t *p_block = *pp_block;
*pp_block = NULL;
if( p_block == NULL )
return NULL;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
block_Release( p_block);
return NULL;
}
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
date_Set( &p_sys->end_date, 0 );
if( p_block->i_pts > VLC_TS_INVALID &&
p_block->i_pts != date_Get( &p_sys->end_date ) )
{
......
......@@ -198,11 +198,11 @@ static picture_t *DecodeBlock(decoder_t *p_dec, block_t **pp_block)
}
p_block = *pp_block;
*pp_block = NULL;
if (p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
block_Release(p_block);
*pp_block = NULL;
return NULL;
}
......@@ -261,6 +261,8 @@ static picture_t *DecodeBlock(decoder_t *p_dec, block_t **pp_block)
p_pic->date = p_block->i_pts > VLC_TS_INVALID ? p_block->i_pts : p_block->i_dts;
block_Release(p_block);
*pp_block = NULL;
return p_pic;
error:
......@@ -269,6 +271,8 @@ error:
free(p_row_pointers);
block_Release(p_block);
*pp_block = NULL;
return NULL;
}
......
......@@ -468,7 +468,6 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL;
p_block = *pp_block;
*pp_block = NULL;
if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{
......
......@@ -307,14 +307,13 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL;
p_block = *pp_block;
*pp_block = NULL;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
if( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) )
{
p_sys->i_max_stop = VLC_TS_INVALID;
block_Release( p_block );
return NULL;
}
*pp_block = NULL;
if( p_block->i_buffer == 0 || p_block->p_buffer[0] == '\0' )
{
......
......@@ -327,15 +327,6 @@ static block_t *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block;
*pp_block = NULL; /* So the packet doesn't get re-sent */
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
date_Set( &p_sys->end_date, 0 );
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
block_Release( p_block );
return NULL;
}
/* Date management */
if( p_block->i_pts > VLC_TS_INVALID &&
p_block->i_pts != date_Get( &p_sys->end_date ) )
......
......@@ -780,7 +780,6 @@ static void *DecodeSync(decoder_t *p_dec, block_t **pp_block)
if (p_block->i_flags & (BLOCK_FLAG_CORRUPTED))
{
block_Release(p_block);
*pp_block = NULL;
return NULL;
}
......@@ -803,7 +802,6 @@ error:
msg_Err(p_dec, "Error in DecodeSync()");
if (p_block)
block_Release(p_block);
*pp_block = NULL;
return NULL;
}
......@@ -844,7 +842,6 @@ static void *DecodeAsync(decoder_t *p_dec, block_t **pp_block)
if (p_block->i_flags & (BLOCK_FLAG_CORRUPTED))
{
block_Release(p_block);
*pp_block = NULL;
return NULL;
}
......@@ -899,7 +896,6 @@ static void *DecodeAsync(decoder_t *p_dec, block_t **pp_block)
error:
msg_Err(p_dec, "Error in DecodeAsync()");
block_Release(p_block);
*pp_block = NULL;
return NULL;
}
......
......@@ -200,19 +200,18 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
block_t *p_block = pp_block ? *pp_block : NULL;
if (p_block)
{
if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
if (p_block) {
if( p_block->i_flags&(BLOCK_FLAG_CORRUPTED) )
{
p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty( &p_sys->bytestream );
date_Set( &p_sys->end_date, 0 );
block_Release( p_block );
return NULL;
}
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
{
date_Set( &p_sys->end_date, 0 );
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty( &p_sys->bytestream );
block_Release( p_block );
*pp_block = NULL;
return NULL;
}
p_sys->b_discontinuity = true;
}
......
......@@ -93,11 +93,10 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
goto error;
}
if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED) )
if( p_block->i_flags & ( BLOCK_FLAG_CORRUPTED ) )
{
date_Set( &p_sys->end_date, 0 );
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
goto error;
goto error;
}
/* Feed mpg123 with raw data */
......
......@@ -1534,7 +1534,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
return 0;
}
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{
block_Release( p_block );
if(!p_sys->in.b_flushed)
......@@ -1652,7 +1652,7 @@ block_t *DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
return 0;
}
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{
block_Release( p_block );
date_Set( &p_sys->end_date, 0 );
......
......@@ -367,22 +367,9 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
{
decoder_sys_t *p_sys = p_dec->p_sys;
block_t *p_block = *pp_block;
*pp_block = NULL; /* To avoid being fed the same packet again */
if( !p_block )
return NULL;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
block_Release( p_block );
return NULL;
}
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
date_Set( &p_sys->end_date, 0 );
/* Date management */
if( p_block->i_pts > VLC_TS_INVALID &&
if( p_block && p_block->i_pts > VLC_TS_INVALID &&
p_block->i_pts != date_Get( &p_sys->end_date ) )
{
date_Set( &p_sys->end_date, p_block->i_pts );
......@@ -391,10 +378,15 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
if( !date_Get( &p_sys->end_date ) )
{
/* We've just started the stream, wait for the first PTS. */
block_Release( p_block );
if( p_block ) block_Release( p_block );
return NULL;
}
*pp_block = NULL; /* To avoid being fed the same packet again */
if( !p_block )
return NULL;
block_t *p_aout_buffer = DecodePacket( p_dec, p_oggpacket,
p_block->i_nb_samples,
(int)p_block->i_length );
......
......@@ -143,9 +143,6 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
block_t *p_block = *pp_block;
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
date_Set( &p_sys->pts, p_block->i_dts );
if( p_block->i_pts <= VLC_TS_INVALID && p_block->i_dts <= VLC_TS_INVALID &&
!date_Get( &p_sys->pts ) )
{
......
......@@ -760,7 +760,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
/* reset the decoder when seeking as the decode in progress is invalid */
/* discard the block as it is just a null magic block */
if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED) ) {
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY ) {
schro_decoder_reset( p_sys->p_schro );
p_sys->i_lastpts = VLC_TS_INVALID;
......
......@@ -534,9 +534,6 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
decoder_sys_t *p_sys = p_dec->p_sys;
block_t *p_block = *pp_block;
if( p_block && p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
date_Set( &p_sys->end_date, 0 );
/* Date management */
if( p_block && p_block->i_pts > VLC_TS_INVALID &&
p_block->i_pts != date_Get( &p_sys->end_date ) )
......
......@@ -207,12 +207,6 @@ static block_t *Reassemble( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block;
*pp_block = NULL;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
block_Release( p_block );
return NULL;
}
if( p_sys->i_spu_size <= 0 &&
( p_block->i_pts <= VLC_TS_INVALID || p_block->i_buffer < 4 ) )
{
......
......@@ -112,8 +112,7 @@ static subpicture_t *Decode(decoder_t *dec, block_t **block)
subpicture_t *sub = NULL;
block_t *b = *block;
*block = NULL;
block_t *b = *block; *block = NULL;
if (b->i_flags & (BLOCK_FLAG_CORRUPTED))
goto exit;
if (b->i_buffer < 128)
......
......@@ -329,9 +329,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL;
p_block = *pp_block;
*pp_block = NULL;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
if( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) )
{
block_Release( p_block );
return NULL;
......@@ -340,6 +338,8 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_spu = ParseText( p_dec, p_block );
block_Release( p_block );
*pp_block = NULL;
return p_spu;
}
......@@ -366,9 +366,6 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
subpicture_t *p_spu = NULL;
char *psz_subtitle = NULL;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
return NULL;
/* We cannot display a subpicture with no date */
if( p_block->i_pts <= VLC_TS_INVALID )
{
......
......@@ -497,9 +497,6 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
subpicture_t *p_spu = NULL;
char *psz_subtitle = NULL;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
return NULL;
/* We cannot display a subpicture with no date */
if( p_block->i_pts <= VLC_TS_INVALID )
{
......
......@@ -223,9 +223,6 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
subpicture_t *p_spu = NULL;
char *psz_subtitle = NULL;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
return NULL;
/* We cannot display a subpicture with no date */
if( p_block->i_pts <= VLC_TS_INVALID )
{
......
......@@ -424,17 +424,9 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
block_t *p_block = *pp_block;
void *p_buf;
*pp_block = NULL; /* To avoid being fed the same packet again */
if( !p_block )
return NULL;
if( ( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY ) != 0 )
p_sys->i_pts = p_block->i_pts;
if( ( p_block->i_flags & BLOCK_FLAG_CORRUPTED ) != 0 )
if( ( p_block->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) ) != 0 )
{
/* Don't send the a corrupted packet to
/* Don't send the the first packet after a discontinuity to
* theora_decode, otherwise we get purple/green display artifacts
* appearing in the video output */
block_Release(p_block);
......@@ -447,6 +439,8 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
p_sys->i_pts = p_block->i_pts;
}
*pp_block = NULL; /* To avoid being fed the same packet again */
if( p_sys->b_packetizer )
{
/* Date management */
......