+ if ((ret = ff_alloc_packet(avpkt, op.bytes))) {
+ av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
+ return ret;
+ }
+ av_fifo_generic_read(s->pkt_fifo, avpkt->data, op.bytes, NULL);
+
+ avpkt->pts = ff_samples_to_time_base(avctx, op.granulepos);
+
+ duration = av_vorbis_parse_frame(s->vp, avpkt->data, avpkt->size);
+ if (duration > 0) {
+ /* we do not know encoder delay until we get the first packet from
+ * libvorbis, so we have to update the AudioFrameQueue counts */
+ if (!avctx->initial_padding) {
+ avctx->initial_padding = duration;
+ s->afq.remaining_delay += duration;
+ s->afq.remaining_samples += duration;