Commit 07686534 authored by Michel Kaempf's avatar Michel Kaempf

* ac3_decoder/ac3_decoder.c :

- m�j de la fr�quence th�orique de chaque frame ac3 ;

* audio_output/audio_output.c :
- d�tection des bouclages de flux et resynkronisation automatique sur la
fr�quence th�orique ;
parent f5c7fdfa
......@@ -217,7 +217,23 @@ static void RunThread( ac3dec_thread_t * p_ac3dec )
{
p_ac3dec->b_invalid = 0;
decode_find_sync( p_ac3dec );
decode_find_sync( p_ac3dec );
/*
p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->l_end_frame] = mdate;
mdate += 32000;
*/
if ( DECODER_FIFO_START(p_ac3dec->fifo)->b_has_pts )
{
p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->l_end_frame] = DECODER_FIFO_START(p_ac3dec->fifo)->i_pts;
DECODER_FIFO_START(p_ac3dec->fifo)->b_has_pts = 0;
}
else
{
p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->l_end_frame] = LAST_MDATE;
}
parse_syncinfo( p_ac3dec );
switch ( p_ac3dec->syncinfo.fscod )
{
case 0:
......@@ -237,22 +253,6 @@ static void RunThread( ac3dec_thread_t * p_ac3dec )
break;
}
/*
p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->l_end_frame] = mdate;
mdate += 32000;
*/
if ( DECODER_FIFO_START(p_ac3dec->fifo)->b_has_pts )
{
p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->l_end_frame] = DECODER_FIFO_START(p_ac3dec->fifo)->i_pts;
DECODER_FIFO_START(p_ac3dec->fifo)->b_has_pts = 0;
}
else
{
p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->l_end_frame] = LAST_MDATE;
}
parse_syncinfo( p_ac3dec );
parse_bsi( p_ac3dec );
/* frame 1 */
......
......@@ -503,13 +503,22 @@ static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo/*,
if ( aout_date < p_fifo->date[p_fifo->l_next_frame] )
{
*/
if ( (p_fifo->date[p_fifo->l_next_frame] - p_fifo->date[p_fifo->l_start_frame] > 1000000) || (p_fifo->date[p_fifo->l_next_frame] <= p_fifo->date[p_fifo->l_start_frame]) )
{
fprintf( stderr, "aout debug: p_fifo->l_rate == %li\n", p_fifo->l_rate );
p_fifo->date[p_fifo->l_start_frame] = p_fifo->date[p_fifo->l_next_frame] - ((1000000 * ((mtime_t)(p_fifo->l_frame_size * ((p_fifo->l_next_frame - p_fifo->l_start_frame) & AOUT_FIFO_SIZE))) >> p_fifo->b_stereo) / ((mtime_t)p_fifo->l_rate));
}
p_fifo->b_next_frame = 1;
break;
if ( p_fifo->date[p_fifo->l_start_frame] >= p_fifo->date[p_fifo->l_next_frame] )
{
fprintf( stderr, "aout debug: %lli >= %lli\n", p_fifo->date[p_fifo->l_start_frame], p_fifo->date[p_fifo->l_next_frame] );
p_fifo->date[p_fifo->l_start_frame] = p_fifo->date[p_fifo->l_next_frame] - ((1000000 * ((mtime_t)(p_fifo->l_frame_size * ((p_fifo->l_next_frame - p_fifo->l_start_frame) & AOUT_FIFO_SIZE))) >> p_fifo->b_stereo) / ((mtime_t)p_fifo->l_rate));
}
else if ( (p_fifo->date[p_fifo->l_next_frame] - p_fifo->date[p_fifo->l_start_frame]) > 1000000 )
{
fprintf( stderr, "aout debug: (%lli - %lli) > 1000000\n", p_fifo->date[p_fifo->l_next_frame], p_fifo->date[p_fifo->l_start_frame] );
p_fifo->date[p_fifo->l_start_frame] = p_fifo->date[p_fifo->l_next_frame] - ((1000000 * ((mtime_t)(p_fifo->l_frame_size * ((p_fifo->l_next_frame - p_fifo->l_start_frame) & AOUT_FIFO_SIZE))) >> p_fifo->b_stereo) / ((mtime_t)p_fifo->l_rate));
}
p_fifo->b_next_frame = 1;
break;
/*
}
else
......
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