if (!packetQueues[streamIndex].isEmpty())
return (AVPacket) packetQueues[streamIndex].dequeue(); // we already have one in the queue for this stream
while (true)
{
final AVPacket packet = new AVPacket();
if (AVFORMAT.av_read_frame(formatCtx, packet) < 0) {
break; // TODO: distinguish between EOM and error?
}
// Is this a packet from the desired stream?