Commit f213c439 authored by Ilkka Ollakka's avatar Ilkka Ollakka

Revert "codec: don't drop discontinue blocks"

This reverts commit 5e36cb2c.
parent d0c57481
...@@ -174,7 +174,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -174,7 +174,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( !pp_block || !*pp_block ) return NULL; if( !pp_block || !*pp_block ) return NULL;
if( (*pp_block)->i_flags&(BLOCK_FLAG_CORRUPTED) ) if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{ {
if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED ) if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
{ {
...@@ -185,10 +185,6 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -185,10 +185,6 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
block_Release( *pp_block ); block_Release( *pp_block );
return NULL; 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) if( !date_Get( &p_sys->end_date ) && (*pp_block)->i_pts <= VLC_TS_INVALID)
{ {
......
...@@ -261,7 +261,7 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block ) ...@@ -261,7 +261,7 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
if( p_sys->b_delayed_open ) if( p_sys->b_delayed_open )
goto end; goto end;
if( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) ) if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{ {
avcodec_flush_buffers( ctx ); avcodec_flush_buffers( ctx );
date_Set( &p_sys->end_date, VLC_TS_INVALID ); date_Set( &p_sys->end_date, VLC_TS_INVALID );
...@@ -272,11 +272,6 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block ) ...@@ -272,11 +272,6 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
goto end; goto end;
} }
if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
{
avcodec_flush_buffers( ctx );
date_Set( &p_sys->end_date, VLC_TS_INVALID );
}
/* We've just started the stream, wait for the first PTS. */ /* We've just started the stream, wait for the first PTS. */
if( !date_Get( &p_sys->end_date ) && p_block->i_pts <= VLC_TS_INVALID ) if( !date_Get( &p_sys->end_date ) && p_block->i_pts <= VLC_TS_INVALID )
......
...@@ -124,13 +124,11 @@ static subpicture_t *DecodeSubtitle(decoder_t *dec, block_t **block_ptr) ...@@ -124,13 +124,11 @@ static subpicture_t *DecodeSubtitle(decoder_t *dec, block_t **block_ptr)
block_t *block = *block_ptr; block_t *block = *block_ptr;
if (block->i_flags & (BLOCK_FLAG_CORRUPTED)) { if (block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED)) {
block_Release(block); block_Release(block);
avcodec_flush_buffers(sys->p_context); avcodec_flush_buffers(sys->p_context);
return NULL; return NULL;
} }
if (block->i_flags & BLOCK_FLAG_DISCONTINUITY)
avcodec_flush_buffers(sys->p_context);
if (block->i_buffer <= 0) { if (block->i_buffer <= 0) {
block_Release(block); block_Release(block);
......
...@@ -102,7 +102,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -102,7 +102,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block; p_block = *pp_block;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED ) if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
{ {
block_Release(p_block); block_Release(p_block);
*pp_block = NULL; *pp_block = NULL;
......
...@@ -143,7 +143,7 @@ static picture_t *Decode( decoder_t *p_dec, block_t **pp_block ) ...@@ -143,7 +143,7 @@ static picture_t *Decode( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
p_block = *pp_block; p_block = *pp_block;
if( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) ) if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{ {
p_sys->i_packet = 0; p_sys->i_packet = 0;
goto exit; goto exit;
......
...@@ -443,7 +443,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -443,7 +443,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block; p_block = *pp_block;
if( p_block ) if( p_block )
{ {
if( ( p_block->i_flags&(BLOCK_FLAG_CORRUPTED) ) == 0 ) if( ( p_block->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) ) == 0 )
{ {
/* Valid input block, so we can send to HW to decode */ /* Valid input block, so we can send to HW to decode */
......
...@@ -404,7 +404,7 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket, ...@@ -404,7 +404,7 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
block_t *p_block = *pp_block; block_t *p_block = *pp_block;
void *p_buf; void *p_buf;
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 the first packet after a discontinuity to /* Don't send the the first packet after a discontinuity to
* daala_decode, otherwise we get purple/green display artifacts * daala_decode, otherwise we get purple/green display artifacts
......
...@@ -130,7 +130,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -130,7 +130,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( stream != NULL if( stream != NULL
&& p_block->i_buffer > 0 && p_block->i_buffer > 0
&& !(p_block->i_flags & (BLOCK_FLAG_CORRUPTED)) ) && !(p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED)) )
{ {
fwrite( p_block->p_buffer, 1, p_block->i_buffer, stream ); fwrite( p_block->p_buffer, 1, p_block->i_buffer, stream );
msg_Dbg( p_dec, "dumped %zu bytes", p_block->i_buffer ); msg_Dbg( p_dec, "dumped %zu bytes", p_block->i_buffer );
......
...@@ -174,16 +174,17 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -174,16 +174,17 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( !pp_block || !*pp_block ) if( !pp_block || !*pp_block )
return NULL; return NULL;
if( (*pp_block)->i_flags&(BLOCK_FLAG_CORRUPTED) ) 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; p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty( &p_sys->bytestream ); block_BytestreamEmpty( &p_sys->bytestream );
}
date_Set( &p_sys->end_date, 0 ); date_Set( &p_sys->end_date, 0 );
block_Release( *pp_block ); block_Release( *pp_block );
return NULL; 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 ) if( !date_Get( &p_sys->end_date ) && (*pp_block)->i_pts <= VLC_TS_INVALID )
{ {
......
...@@ -210,7 +210,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -210,7 +210,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block; p_block = *pp_block;
if( p_block->i_flags&(BLOCK_FLAG_CORRUPTED) ) if( p_block->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{ {
block_Release( p_block ); block_Release( p_block );
return NULL; return NULL;
......
...@@ -500,7 +500,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -500,7 +500,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( !pp_block || !*pp_block ) if( !pp_block || !*pp_block )
return NULL; return NULL;
if( (*pp_block)->i_flags&(BLOCK_FLAG_CORRUPTED) ) if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{ {
block_Release( *pp_block ); block_Release( *pp_block );
return NULL; return NULL;
......
...@@ -679,12 +679,9 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -679,12 +679,9 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys->b_prerolled = false; p_sys->b_prerolled = false;
} }
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
block_Release( p_block ); block_Release( p_block );
goto done; goto done;
} }
}
if( likely( p_block->i_buffer ) ) if( likely( p_block->i_buffer ) )
{ {
......
...@@ -199,7 +199,7 @@ static picture_t *DecodeBlock(decoder_t *p_dec, block_t **pp_block) ...@@ -199,7 +199,7 @@ static picture_t *DecodeBlock(decoder_t *p_dec, block_t **pp_block)
p_block = *pp_block; p_block = *pp_block;
if (p_block->i_flags & BLOCK_FLAG_CORRUPTED ) if (p_block->i_flags & BLOCK_FLAG_DISCONTINUITY)
{ {
block_Release(p_block); block_Release(p_block);
*pp_block = NULL; *pp_block = NULL;
......
...@@ -480,13 +480,10 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -480,13 +480,10 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
vlc_mutex_unlock( &p_sys->lock ); vlc_mutex_unlock( &p_sys->lock );
} }
#endif #endif
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED )
{
p_sys->i_max_stop = VLC_TS_INVALID; p_sys->i_max_stop = VLC_TS_INVALID;
block_Release( p_block ); block_Release( p_block );
return NULL; return NULL;
} }
}
/* Block to Kate packet */ /* Block to Kate packet */
kate_packet_wrap(&kp, p_block->i_buffer, p_block->p_buffer); kate_packet_wrap(&kp, p_block->i_buffer, p_block->p_buffer);
......
...@@ -307,7 +307,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -307,7 +307,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
p_block = *pp_block; p_block = *pp_block;
if( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) ) if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{ {
p_sys->i_max_stop = VLC_TS_INVALID; p_sys->i_max_stop = VLC_TS_INVALID;
block_Release( p_block ); block_Release( p_block );
......
...@@ -261,7 +261,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -261,7 +261,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
p_block = *pp_block; p_block = *pp_block;
if( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) ) if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED) )
Reset( p_dec ); Reset( p_dec );
while( 1 ) while( 1 )
......
...@@ -777,7 +777,7 @@ static void *DecodeSync(decoder_t *p_dec, block_t **pp_block) ...@@ -777,7 +777,7 @@ static void *DecodeSync(decoder_t *p_dec, block_t **pp_block)
return NULL; return NULL;
block_t *p_block = *pp_block; block_t *p_block = *pp_block;
if (p_block->i_flags & (BLOCK_FLAG_CORRUPTED)) if (p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED))
{ {
block_Release(p_block); block_Release(p_block);
return NULL; return NULL;
...@@ -839,9 +839,10 @@ static void *DecodeAsync(decoder_t *p_dec, block_t **pp_block) ...@@ -839,9 +839,10 @@ static void *DecodeAsync(decoder_t *p_dec, block_t **pp_block)
return NULL; return NULL;
block_t *p_block = *pp_block; block_t *p_block = *pp_block;
if (p_block->i_flags & (BLOCK_FLAG_CORRUPTED)) if (p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED))
{ {
block_Release(p_block); block_Release(p_block);
return NULL; return NULL;
} }
......
...@@ -201,18 +201,17 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -201,18 +201,17 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
block_t *p_block = pp_block ? *pp_block : NULL; block_t *p_block = pp_block ? *pp_block : NULL;
if (p_block) { if (p_block) {
if( p_block->i_flags&(BLOCK_FLAG_CORRUPTED) ) if( p_block->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{
if( p_block->i_flags&BLOCK_FLAG_CORRUPTED )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty( &p_sys->bytestream ); 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 ); date_Set( &p_sys->end_date, 0 );
block_Release( p_block );
p_sys->b_discontinuity = true; p_sys->b_discontinuity = true;
return NULL;
} }
if( !date_Get( &p_sys->end_date ) && p_block->i_pts <= VLC_TS_INVALID ) if( !date_Get( &p_sys->end_date ) && p_block->i_pts <= VLC_TS_INVALID )
...@@ -293,6 +292,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -293,6 +292,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
msg_Dbg( p_dec, "emulated startcode" ); msg_Dbg( p_dec, "emulated startcode" );
block_SkipByte( &p_sys->bytestream ); block_SkipByte( &p_sys->bytestream );
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
p_sys->b_discontinuity = true;
break; break;
} }
...@@ -367,6 +367,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -367,6 +367,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
msg_Dbg( p_dec, "emulated startcode on next frame" ); msg_Dbg( p_dec, "emulated startcode on next frame" );
block_SkipByte( &p_sys->bytestream ); block_SkipByte( &p_sys->bytestream );
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
p_sys->b_discontinuity = true;
break; break;
} }
......
...@@ -93,7 +93,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -93,7 +93,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
goto error; goto error;
} }
if( p_block->i_flags & ( BLOCK_FLAG_CORRUPTED ) ) if( p_block->i_flags & ( BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED ) )
{ {
date_Set( &p_sys->end_date, 0 ); date_Set( &p_sys->end_date, 0 );
goto error; goto error;
......
...@@ -205,7 +205,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -205,7 +205,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block; p_block = *pp_block;
p_sys->b_error = false; p_sys->b_error = false;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED ) if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
{ {
block_Release( p_block ); *pp_block = NULL; block_Release( p_block ); *pp_block = NULL;
return NULL; return NULL;
......
...@@ -416,7 +416,7 @@ static subpicture_t *Decode(decoder_t *dec, block_t **block) ...@@ -416,7 +416,7 @@ static subpicture_t *Decode(decoder_t *dec, block_t **block)
subpicture_t *sub_first = NULL; subpicture_t *sub_first = NULL;
subpicture_t **sub_last = &sub_first; subpicture_t **sub_last = &sub_first;
if (b->i_flags & (BLOCK_FLAG_CORRUPTED)) if (b->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED))
goto exit; goto exit;
while (b->i_buffer > 3) { while (b->i_buffer > 3) {
......
...@@ -137,7 +137,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -137,7 +137,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( pp_block == NULL || *pp_block == NULL ) return NULL; if( pp_block == NULL || *pp_block == NULL ) return NULL;
p_block = *pp_block; p_block = *pp_block;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED ) if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
{ {
block_Release( p_block ); *pp_block = NULL; block_Release( p_block ); *pp_block = NULL;
return NULL; return NULL;
......
...@@ -113,7 +113,7 @@ static subpicture_t *Decode(decoder_t *dec, block_t **block) ...@@ -113,7 +113,7 @@ static subpicture_t *Decode(decoder_t *dec, block_t **block)
subpicture_t *sub = NULL; subpicture_t *sub = NULL;
block_t *b = *block; *block = NULL; block_t *b = *block; *block = NULL;
if (b->i_flags & (BLOCK_FLAG_CORRUPTED)) if (b->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED))
goto exit; goto exit;
if (b->i_buffer < 128) if (b->i_buffer < 128)
goto exit; goto exit;
......
...@@ -329,7 +329,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -329,7 +329,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
p_block = *pp_block; p_block = *pp_block;
if( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) ) if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{ {
block_Release( p_block ); block_Release( p_block );
return NULL; return NULL;
......
...@@ -282,7 +282,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block ) ...@@ -282,7 +282,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block; p_block = *pp_block;
*pp_block = NULL; *pp_block = NULL;
if( ( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) ) || if( ( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) ) ||
p_block->i_buffer < sizeof(uint16_t) ) p_block->i_buffer < sizeof(uint16_t) )
{ {
block_Release( p_block ); block_Release( p_block );
......
...@@ -234,7 +234,7 @@ static block_t *Reassemble( decoder_t *p_dec, block_t *p_block ) ...@@ -234,7 +234,7 @@ static block_t *Reassemble( decoder_t *p_dec, block_t *p_block )
uint16_t i_expected_image; uint16_t i_expected_image;
uint8_t i_packet, i_expected_packet; uint8_t i_packet, i_expected_packet;
if( p_block->i_flags & (BLOCK_FLAG_CORRUPTED) ) if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{ {
block_Release( p_block ); block_Release( p_block );
return NULL; return NULL;
......
...@@ -136,7 +136,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -136,7 +136,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block; p_block = *pp_block;
*pp_block = NULL; *pp_block = NULL;
if( p_block->i_flags & BLOCK_FLAG_CORRUPTED) if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
{ {
block_Release( p_block ); block_Release( p_block );
return NULL; return NULL;
......
...@@ -62,14 +62,13 @@ static block_t *Decode(decoder_t *dec, block_t **block_ptr) ...@@ -62,14 +62,13 @@ static block_t *Decode(decoder_t *dec, block_t **block_ptr)
return NULL; return NULL;
block_t *block = *block_ptr; block_t *block = *block_ptr;
if (block->i_flags & (BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED)) {
if (block->i_flags & BLOCK_FLAG_CORRUPTED) { if (block->i_flags & BLOCK_FLAG_CORRUPTED) {
}
date_Set(&sys->end_date, 0); date_Set(&sys->end_date, 0);
block_Release(block); block_Release(block);
return NULL; return NULL;
} }
if (block->i_flags & BLOCK_FLAG_DISCONTINUITY) {
date_Set(&sys->end_date, 0);
}
if (block->i_pts > VLC_TS_INVALID && if (block->i_pts > VLC_TS_INVALID &&
block->i_pts != date_Get(&sys->end_date)) block->i_pts != date_Get(&sys->end_date))
......
...@@ -929,7 +929,7 @@ static picture_t *DecodeBlock(decoder_t *p_dec, block_t **pp_block) ...@@ -929,7 +929,7 @@ static picture_t *DecodeBlock(decoder_t *p_dec, block_t **pp_block)
p_block = *pp_block; p_block = *pp_block;
if (likely(p_block != NULL)) { if (likely(p_block != NULL)) {
if (unlikely(p_block->i_flags&(BLOCK_FLAG_CORRUPTED))) { if (unlikely(p_block->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED))) {
if (likely(p_sys->b_started)) { if (likely(p_sys->b_started)) {
@synchronized(p_sys->outputTimeStamps) { @synchronized(p_sys->outputTimeStamps) {
[p_sys->outputTimeStamps removeAllObjects]; [p_sys->outputTimeStamps removeAllObjects];
......
...@@ -72,7 +72,7 @@ static picture_t *Decode(decoder_t *dec, block_t **pp_block) ...@@ -72,7 +72,7 @@ static picture_t *Decode(decoder_t *dec, block_t **pp_block)
if (!block) if (!block)
return NULL; return NULL;
if (block->i_flags & (BLOCK_FLAG_CORRUPTED)) { if (block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED))
block_Release(block); block_Release(block);
return NULL; return NULL;
} }
......
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