};
static const EbmlSyntax matroska_chapter_display[] = {
- { MATROSKA_ID_CHAPSTRING, EBML_UTF8, 0, offsetof(MatroskaChapter, title) },
- { MATROSKA_ID_CHAPLANG, EBML_NONE },
+ { MATROSKA_ID_CHAPSTRING, EBML_UTF8, 0, offsetof(MatroskaChapter, title) },
+ { MATROSKA_ID_CHAPLANG, EBML_NONE },
+ { MATROSKA_ID_CHAPCOUNTRY, EBML_NONE },
{ 0 }
};
index_list = &matroska->index;
index = index_list->elem;
- if (index_list->nb_elem &&
- index[0].time > 1E14 / matroska->time_scale) {
- av_log(matroska->ctx, AV_LOG_WARNING, "Working around broken index.\n");
- index_scale = matroska->time_scale;
+ if (index_list->nb_elem < 2)
+ return;
+ if (index[1].time > 1E14 / matroska->time_scale) {
+ av_log(matroska->ctx, AV_LOG_WARNING, "Dropping apparently-broken index.\n");
+ return;
}
for (i = 0; i < index_list->nb_elem; i++) {
EbmlList *pos_list = &index[i].pos;
if (matroska->packets) {
int n;
for (n = 0; n < matroska->num_packets; n++) {
- av_free_packet(matroska->packets[n]);
+ av_packet_unref(matroska->packets[n]);
av_freep(&matroska->packets[n]);
}
av_freep(&matroska->packets);
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL,
additional_size + 8);
if (!side_data) {
- av_free_packet(pkt);
+ av_packet_unref(pkt);
av_free(pkt);
return AVERROR(ENOMEM);
}
AV_PKT_DATA_SKIP_SAMPLES,
10);
if (!side_data) {
- av_free_packet(pkt);
+ av_packet_unref(pkt);
av_free(pkt);
return AVERROR(ENOMEM);
}
else
pkt->pts = timecode;
pkt->pos = pos;
+ pkt->duration = lace_duration;
+
+#if FF_API_CONVERGENCE_DURATION
+FF_DISABLE_DEPRECATION_WARNINGS
if (st->codec->codec_id == AV_CODEC_ID_SUBRIP) {
- /*
- * For backward compatibility.
- * Historically, we have put subtitle duration
- * in convergence_duration, on the off chance
- * that the time_scale is less than 1us, which
- * could result in a 32bit overflow on the
- * normal duration field.
- */
pkt->convergence_duration = lace_duration;
}
-
- if (track->type != MATROSKA_TRACK_TYPE_SUBTITLE ||
- lace_duration <= INT_MAX) {
- /*
- * For non subtitle tracks, just store the duration
- * as normal.
- *
- * If it's a subtitle track and duration value does
- * not overflow a uint32, then also store it normally.
- */
- pkt->duration = lace_duration;
- }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
dynarray_add(&matroska->packets, &matroska->num_packets, pkt);
matroska->prev_pkt = pkt;