libfaac: Queue input is backward in time

Harit Vishwakarma picture Harit Vishwakarma · Feb 28, 2014 · Viewed 7.9k times · Source

I am using libav along with libfaac to encode audio into aac. following is the logic:

frames[n]
i = 0 ;
while (there are frames)
{ 
  cur_frame =  frames[i];
  av_encode_audio(frame, ...., &frame_finished);
  if( frame_finished )
  {
     i++;
  }
}

but I am getting this annoying warning for few frames "queue input is backward in time !"

Answer

Harit Vishwakarma picture Harit Vishwakarma · Feb 28, 2014

The answer is very simple, you are not supposed to pass the same frame again to the libfaac, so even if the frame_finished is not 1 you should still go to the next frame.

it should be as follows:

frames[n]
i = 0 ;
while (there are frames)
{ 
  cur_frame =  frames[i];
  av_encode_audio(frame, ...., &frame_finished);
  i++;
}