+ avpkt->data, avpkt->size);
+ if (bytes_written < 0) {
+ av_log(avctx, AV_LOG_ERROR, "faacEncEncode() error\n");
+ return bytes_written;
+ }
+
+ /* add current frame to the queue */
+ if (frame) {
+ if ((ret = ff_af_queue_add(&s->afq, frame) < 0))
+ return ret;
+ }