* for short periods that are guaranteed not to overlap
* with calls to av_read_frame() (or ff_read_packet())
* or with each other.
+ * It may be used by demuxers as a replacement for
+ * stack packets (unless they call one of the aforementioned
+ * functions with their own AVFormatContext).
* Every user has to ensure that this packet is blank
* after using it.
*/
/* byte position of the segment inside the stream */
int64_t segment_start;
+ /* This packet coincides with AVFormatInternal.parse_pkt
+ * and is not owned by us. */
AVPacket *pkt;
/* the packet queue */
}
ebml_free(ebml_syntax, &ebml);
- matroska->pkt = av_packet_alloc();
- if (!matroska->pkt)
- return AVERROR(ENOMEM);
+ matroska->pkt = s->internal->parse_pkt;
/* The next thing is a segment. */
pos = avio_tell(matroska->ctx->pb);
if (!pkt_size && !additional_size)
goto no_output;
- av_packet_unref(pkt);
if (!buf)
pkt->buf = av_buffer_create(pkt_data, pkt_size + AV_INPUT_BUFFER_PADDING_SIZE,
NULL, NULL, 0);
int n;
matroska_clear_queue(matroska);
- av_packet_free(&matroska->pkt);
for (n = 0; n < matroska->tracks.nb_elem; n++)
if (tracks[n].type == MATROSKA_TRACK_TYPE_AUDIO)