Commit 3801da9d authored by Laurent Aimar's avatar Laurent Aimar

Fixed various decoder/packetizer flush.

parent d042c129
...@@ -189,7 +189,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -189,7 +189,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED ) if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream ); block_BytestreamEmpty( &p_sys->bytestream );
} }
aout_DateSet( &p_sys->end_date, 0 ); aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block ); block_Release( *pp_block );
......
...@@ -189,7 +189,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -189,7 +189,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED ) if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream ); block_BytestreamEmpty( &p_sys->bytestream );
} }
aout_DateSet( &p_sys->end_date, 0 ); aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block ); block_Release( *pp_block );
......
...@@ -386,7 +386,7 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -386,7 +386,7 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED ) if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream ); block_BytestreamEmpty( &p_sys->bytestream );
} }
aout_DateSet( &p_sys->end_date, 0 ); aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block ); block_Release( *pp_block );
......
...@@ -208,7 +208,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -208,7 +208,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED ) if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream ); block_BytestreamEmpty( &p_sys->bytestream );
} }
aout_DateSet( &p_sys->end_date, 0 ); aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block ); block_Release( *pp_block );
......
...@@ -421,7 +421,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block ) ...@@ -421,7 +421,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED ) if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream ); block_BytestreamEmpty( &p_sys->bytestream );
if( p_sys->p_frame ) if( p_sys->p_frame )
block_ChainRelease( p_sys->p_frame ); block_ChainRelease( p_sys->p_frame );
...@@ -429,6 +429,9 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block ) ...@@ -429,6 +429,9 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
p_sys->slice.i_frame_type = 0; p_sys->slice.i_frame_type = 0;
p_sys->b_slice = false; p_sys->b_slice = false;
} }
p_sys->i_frame_pts = -1;
p_sys->i_frame_dts = -1;
block_Release( *pp_block ); block_Release( *pp_block );
return NULL; return NULL;
} }
......
...@@ -165,7 +165,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block ) ...@@ -165,7 +165,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
{ {
p_sys->b_mlp = false; p_sys->b_mlp = false;
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream ); block_BytestreamEmpty( &p_sys->bytestream );
} }
aout_DateSet( &p_sys->end_date, 0 ); aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block ); block_Release( *pp_block );
......
...@@ -972,9 +972,9 @@ static block_t *PacketizeStreamBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -972,9 +972,9 @@ static block_t *PacketizeStreamBlock( decoder_t *p_dec, block_t **pp_block )
if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED ) if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream ); block_BytestreamEmpty( &p_sys->bytestream );
} }
//aout_DateSet( &p_sys->end_date, 0 ); aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block ); block_Release( *pp_block );
return NULL; return NULL;
} }
......
...@@ -229,20 +229,20 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block ) ...@@ -229,20 +229,20 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED ) if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream ); block_BytestreamEmpty( &p_sys->bytestream );
if( p_sys->p_frame ) if( p_sys->p_frame )
block_ChainRelease( p_sys->p_frame ); block_ChainRelease( p_sys->p_frame );
p_sys->p_frame = NULL; p_sys->p_frame = NULL;
p_sys->pp_last = &p_sys->p_frame; p_sys->pp_last = &p_sys->p_frame;
} }
// p_sys->i_interpolated_pts = p_sys->i_interpolated_pts =
// p_sys->i_interpolated_dts = p_sys->i_interpolated_dts =
// p_sys->i_last_ref_pts = p_sys->i_last_ref_pts =
// p_sys->i_last_time_ref = p_sys->i_last_time_ref =
// p_sys->i_time_ref = p_sys->i_time_ref =
// p_sys->i_last_time = p_sys->i_last_time =
// p_sys->i_last_timeincr = 0; p_sys->i_last_timeincr = 0;
block_Release( *pp_block ); block_Release( *pp_block );
return NULL; return NULL;
......
...@@ -263,7 +263,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block ) ...@@ -263,7 +263,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED ) if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream ); block_BytestreamEmpty( &p_sys->bytestream );
p_sys->b_discontinuity = true; p_sys->b_discontinuity = true;
if( p_sys->p_frame ) if( p_sys->p_frame )
...@@ -272,8 +272,10 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block ) ...@@ -272,8 +272,10 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
p_sys->pp_last = &p_sys->p_frame; p_sys->pp_last = &p_sys->p_frame;
p_sys->b_frame_slice = false; p_sys->b_frame_slice = false;
} }
// p_sys->i_interpolated_dts = p_sys->i_dts = 0;
// p_sys->i_last_ref_pts = 0; p_sys->i_pts = 0;
p_sys->i_interpolated_dts = 0;
p_sys->i_last_ref_pts = 0;
block_Release( *pp_block ); block_Release( *pp_block );
return NULL; return NULL;
......
...@@ -203,7 +203,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block ) ...@@ -203,7 +203,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED ) if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
{ {
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream ); block_BytestreamEmpty( &p_sys->bytestream );
if( p_sys->p_frame ) if( p_sys->p_frame )
block_ChainRelease( p_sys->p_frame ); block_ChainRelease( p_sys->p_frame );
...@@ -211,7 +211,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block ) ...@@ -211,7 +211,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
p_sys->pp_last = &p_sys->p_frame; p_sys->pp_last = &p_sys->p_frame;
p_sys->b_frame = false; p_sys->b_frame = false;
} }
// p_sys->i_interpolated_dts = 0; p_sys->i_interpolated_dts = 0;
block_Release( *pp_block ); block_Release( *pp_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