/* 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);
attachments[j].stream = st;
if (st->codecpar->codec_id != AV_CODEC_ID_NONE) {
- AVPacket *pkt = &st->attached_pic;
-
- st->disposition |= AV_DISPOSITION_ATTACHED_PIC;
- st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
-
- av_packet_unref(pkt);
- pkt->buf = attachments[j].bin.buf;
- attachments[j].bin.buf = NULL;
- pkt->data = attachments[j].bin.data;
- pkt->size = attachments[j].bin.size;
- pkt->stream_index = st->index;
- pkt->flags |= AV_PKT_FLAG_KEY;
+ res = ff_add_attached_pic(s, st, NULL, &attachments[j].bin.buf, 0);
+ if (res < 0)
+ goto fail;
} else {
st->codecpar->codec_type = AVMEDIA_TYPE_ATTACHMENT;
if (ff_alloc_extradata(st->codecpar, attachments[j].bin.size))
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);
pkt->pos = pos;
pkt->duration = lace_duration;
-#if FF_API_CONVERGENCE_DURATION
-FF_DISABLE_DEPRECATION_WARNINGS
- if (st->codecpar->codec_id == AV_CODEC_ID_SUBRIP) {
- pkt->convergence_duration = lace_duration;
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
res = avpriv_packet_list_put(&matroska->queue, &matroska->queue_end, pkt, NULL, 0);
if (res < 0) {
av_packet_unref(pkt);
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)
.version = LIBAVUTIL_VERSION_INT,
};
-AVInputFormat ff_matroska_demuxer = {
+const AVInputFormat ff_matroska_demuxer = {
.name = "matroska,webm",
.long_name = NULL_IF_CONFIG_SMALL("Matroska / WebM"),
.extensions = "mkv,mk3d,mka,mks,webm",
.mime_type = "audio/webm,audio/x-matroska,video/webm,video/x-matroska"
};
-AVInputFormat ff_webm_dash_manifest_demuxer = {
+const AVInputFormat ff_webm_dash_manifest_demuxer = {
.name = "webm_dash_manifest",
.long_name = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"),
.priv_data_size = sizeof(MatroskaDemuxContext),