Commit a47bce5f authored by Michel Kaempf's avatar Michel Kaempf
Browse files

* ac3_decoder/ac3_decoder.c, audio_output/audio_output.c :

- modification de la synkro, d�tection de la fr�quence du flux ac3 ;
parent e4ea0558
......@@ -214,6 +214,26 @@ static void RunThread( ac3dec_thread_t * p_ac3dec )
}
parse_syncinfo( p_ac3dec );
/*
switch ( p_ac3dec->syncinfo.fscod )
{
case 0:
p_ac3dec->p_aout_fifo->l_rate = 48000;
break;
case 1:
p_ac3dec->p_aout_fifo->l_rate = 44100;
break;
case 2:
p_ac3dec->p_aout_fifo->l_rate = 32000;
break;
default:
fprintf( stderr, "ac3dec debug: fscod == `11' (reserved)\n" );
break;
}
*/
parse_bsi( p_ac3dec );
/* frame 1 */
......
......@@ -504,9 +504,10 @@ static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo/*,
{
*/
/*
if ( p_fifo->date[p_fifo->l_next_frame] - p_fifo->date[p_fifo->l_start_frame] > 1000000 )
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]) )
{
p_fifo->date[p_fifo->l_start_frame] = p_fifo->date[p_fifo->l_next_frame] - ((1000000 * AOUT_FRAME_SIZE * ((mtime_t)((p_fifo->l_next_frame - p_fifo->l_start_frame) & AOUT_FIFO_SIZE)) >> p_fifo->b_stereo) / ((mtime_t)p_fifo->l_rate));
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;
......@@ -540,6 +541,7 @@ static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo/*,
l_rate = (long)( ((mtime_t)l_units * 1000000)
/ (p_fifo->date[p_fifo->l_next_frame] - p_fifo->date[p_fifo->l_start_frame]) );
// fprintf( stderr, "aout debug: l_rate == %li\n", l_rate );
InitializeIncrement( &p_fifo->unit_increment, l_rate, p_aout->dsp.l_rate );
......
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