Commit 875bcdf1 authored by Laurent Aimar's avatar Laurent Aimar

Correctly reset date after a discontinuity in audio decoder.

parent d5d6a32a
......@@ -191,7 +191,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream );
}
// aout_DateSet( &p_sys->end_date, 0 );
aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block );
return NULL;
}
......
......@@ -261,6 +261,8 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
{
block_Release( p_block );
avcodec_flush_buffers( p_sys->p_context );
p_sys->i_samples = 0;
aout_DateSet( &p_sys->end_date, 0 );
if( p_sys->i_codec_id == CODEC_ID_MP2 || p_sys->i_codec_id == CODEC_ID_MP3 )
p_sys->i_reject_count = 3;
......
......@@ -179,7 +179,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream );
}
// aout_DateSet( &p_sys->end_date, 0 );
aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block );
return NULL;
}
......
......@@ -388,7 +388,7 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream );
}
// aout_DateSet( &p_sys->end_date, 0 );
aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block );
return NULL;
}
......
......@@ -208,7 +208,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream );
}
// aout_DateSet( &p_sys->end_date, 0 );
aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block );
p_sys->b_discontinuity = true;
return NULL;
......
......@@ -166,6 +166,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
p_sys->i_state = STATE_NOSYNC;
block_BytestreamFlush( &p_sys->bytestream );
}
aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block );
return NULL;
}
......
......@@ -290,7 +290,7 @@ static block_t *PacketizeRawBlock( decoder_t *p_dec, block_t **pp_block )
if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{
//aout_DateSet( &p_sys->end_date, 0 );
aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block );
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