Commit af489315 authored by Ilkka Ollakka's avatar Ilkka Ollakka

avcodec: check i_samples_delay before rewinding date

parent 50c01bdb
......@@ -1140,7 +1140,8 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf )
{
date_Set( &p_sys->buffer_date, p_aout_buf->i_dts );
/* take back amount we have leftover from previous buffer*/
date_Decrement( &p_sys->buffer_date, p_sys->i_samples_delay );
if( p_sys->i_samples_delay > 0 )
date_Decrement( &p_sys->buffer_date, p_sys->i_samples_delay );
}
// Check if we have enough samples in delay_buffer and current p_aout_buf to fill frame
......
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