Commit a3875cd4 authored by Michel Kaempf's avatar Michel Kaempf

* audio_decoder/audio_decoder.c :

- Correction d'un bug concernant la d�cision de d�coder ou non une
nouvelle frame audio ;

-- MaXX
parent 96f414c1
......@@ -816,7 +816,6 @@ static void RunThread( adec_thread_t * p_adec )
}
else
{
/* adec_Layer2_Stereo() produces 6 output frames (2*1152/384) */
// i_header = p_adec->bit_stream.fifo.buffer;
// i_framesize = pi_framesize[ 128*((i_header & ADEC_HEADER_LAYER_MASK) >> ADEC_HEADER_LAYER_SHIFT) +
// 64*((i_header & ADEC_HEADER_PADDING_BIT_MASK) >> ADEC_HEADER_PADDING_BIT_SHIFT) +
......@@ -835,8 +834,12 @@ static void RunThread( adec_thread_t * p_adec )
// }
pthread_mutex_lock( &p_adec->p_aout_fifo->data_lock );
/* (((end + 6) - start) & AOUT_FIFO_SIZE) < 6 */
while ( ((p_adec->p_aout_fifo->l_start_frame - p_adec->p_aout_fifo->l_end_frame) & AOUT_FIFO_SIZE) < 6 ) /* !! */
/* adec_Layer2_Stereo() produces 6 output frames (2*1152/384)...
* If these 6 frames would be recorded in the audio output fifo,
* the l_end_frame index would be incremented 6 times. But, if after
* this operation the audio output fifo would contain less than 6 frames,
* it would mean that we had not enough room to store the 6 frames :-P */
while ( (((p_adec->p_aout_fifo->l_end_frame + 6) - p_adec->p_aout_fifo->l_start_frame) & AOUT_FIFO_SIZE) < 6 ) /* !! */
{
pthread_cond_wait( &p_adec->p_aout_fifo->data_wait, &p_adec->p_aout_fifo->data_lock );
}
......
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