254 static const uint8_t mxf_header_partition_pack_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02 };
255 static const uint8_t mxf_essence_element_key[] = { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01 };
256 static const uint8_t mxf_avid_essence_element_key[] = { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0e,0x04,0x03,0x01 };
257 static const uint8_t mxf_system_item_key[] = { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0D,0x01,0x03,0x01,0x04 };
260 static const uint8_t mxf_crypto_source_container_ul[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x09,0x06,0x01,0x01,0x02,0x02,0x00,0x00,0x00 };
261 static const uint8_t mxf_encrypted_triplet_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x04,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x7e,0x01,0x00 };
262 static const uint8_t mxf_encrypted_essence_container[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0b,0x01,0x00 };
263 static const uint8_t mxf_random_index_pack_key[] = { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0D,0x01,0x02,0x01,0x01,0x11,0x01,0x00 };
264 static const uint8_t mxf_sony_mpeg4_extradata[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00 };
266 #define IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y)))
272 int bytes_num = size & 0x7f;
278 size = size << 8 |
avio_r8(pb);
286 for (i = 0; i < size && !
url_feof(pb); i++) {
290 else if (b != key[i])
304 return klv->
length == -1 ? -1 : 0;
324 const uint8_t *buf_ptr, *end_ptr;
333 data_ptr = pkt->
data;
335 buf_ptr = pkt->
data + 4;
338 uint32_t
sample = bytestream_get_le32(&buf_ptr);
340 bytestream_put_le24(&data_ptr, (sample >> 4) & 0xffffff);
342 bytestream_put_le16(&data_ptr, (sample >> 12) & 0xffff);
352 static const uint8_t checkv[16] = {0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b};
358 uint64_t plaintext_size;
385 if (orig_size < plaintext_size)
389 if (size < 32 || size - 32 < orig_size)
395 if (memcmp(tmpbuf, checkv, 16))
401 else if (size < plaintext_size)
403 size -= plaintext_size;
406 &pkt->
data[plaintext_size], size >> 4, ivec, 1);
419 if (item_len != 18) {
423 if (item_num > 65536) {
440 uint64_t footer_partition;
441 uint32_t nb_essence_containers;
460 memset(partition, 0,
sizeof(*partition));
499 if (footer_partition) {
502 "inconsistent FooterPartition value: %"PRIu64
" != %"PRIu64
"\n",
510 "PartitionPack: ThisPartition = 0x%"PRIX64
511 ", PreviousPartition = 0x%"PRIX64
", "
512 "FooterPartition = 0x%"PRIX64
", IndexSID = %i, BodySID = %i\n",
521 "PreviousPartition points to this partition or forward\n");
525 if (op[12] == 1 && op[13] == 1) mxf->
op =
OP1a;
526 else if (op[12] == 1 && op[13] == 2) mxf->
op =
OP1b;
527 else if (op[12] == 1 && op[13] == 3) mxf->
op =
OP1c;
528 else if (op[12] == 2 && op[13] == 1) mxf->
op =
OP2a;
529 else if (op[12] == 2 && op[13] == 2) mxf->
op =
OP2b;
530 else if (op[12] == 2 && op[13] == 3) mxf->
op =
OP2c;
531 else if (op[12] == 3 && op[13] == 1) mxf->
op =
OP3a;
532 else if (op[12] == 3 && op[13] == 2) mxf->
op =
OP3b;
533 else if (op[12] == 3 && op[13] == 3) mxf->
op =
OP3c;
534 else if (op[12] == 64&& op[13] == 1) mxf->
op =
OPSONYOpt;
535 else if (op[12] == 0x10) {
540 if (nb_essence_containers != 1) {
546 nb_essence_containers, op ==
OP1a ?
"OP1a" :
"OPAtom");
552 av_log(mxf->
fc,
AV_LOG_ERROR,
"unknown operational pattern: %02xh %02xh - guessing OP1a\n", op[12], op[13]);
637 package->tracks_refs =
av_calloc(package->tracks_count,
sizeof(
UID));
638 if (!package->tracks_refs)
713 package->tracks_refs =
av_calloc(package->tracks_count,
sizeof(
UID));
714 if (!package->tracks_refs)
725 avio_read(pb, package->descriptor_ref, 16);
771 av_dlog(NULL,
"IndexEntryArray found\n");
793 int code,
value, ofs = 0;
799 av_dlog(NULL,
"pixel layout: code %#x\n", code);
802 layout[ofs++] = code;
803 layout[ofs++] =
value;
899 for (i = 0; i <
len; i++) {
900 if (i != 7 && key[i] != uid[i])
908 while (uls->
uid[0]) {
933 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 14,
AV_CODEC_ID_MPEG2VIDEO },
934 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 14,
AV_CODEC_ID_DVVIDEO },
935 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x05,0x00,0x00 }, 14,
AV_CODEC_ID_RAWVIDEO },
936 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,
AV_CODEC_ID_NONE },
941 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x00,0x00 }, 14,
AV_CODEC_ID_MPEG2VIDEO },
942 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,
AV_CODEC_ID_NONE },
947 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x01,0x32,0x00,0x00 }, 14,
AV_CODEC_ID_H264 },
948 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x07,0x04,0x01,0x02,0x02,0x03,0x01,0x01,0x00 }, 14,
AV_CODEC_ID_JPEG2000 },
949 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,
AV_CODEC_ID_NONE },
954 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 14,
AV_CODEC_ID_PCM_S16LE },
955 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x40,0x01 }, 14,
AV_CODEC_ID_MP2 },
956 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 }, 14,
AV_CODEC_ID_PCM_S16LE },
957 { { 0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0xFF,0x4B,0x46,0x41,0x41,0x00,0x0D,0x4D,0x4F }, 14,
AV_CODEC_ID_PCM_S16LE },
958 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,
AV_CODEC_ID_NONE },
963 int i, j, nb_segments = 0;
965 int last_body_sid = -1, last_index_sid = -1, last_index_start = -1;
975 if (!(unsorted_segments =
av_calloc(nb_segments,
sizeof(*unsorted_segments))) ||
976 !(*sorted_segments =
av_calloc(nb_segments,
sizeof(**sorted_segments)))) {
986 *nb_sorted_segments = 0;
989 for (i = 0; i < nb_segments; i++) {
990 int best = -1, best_body_sid = -1, best_index_sid = -1, best_index_start = -1;
991 uint64_t best_index_duration = 0;
993 for (j = 0; j < nb_segments; j++) {
1015 (*sorted_segments)[(*nb_sorted_segments)++] = unsorted_segments[best];
1016 last_body_sid = best_body_sid;
1017 last_index_sid = best_index_sid;
1018 last_index_start = best_index_start;
1032 int64_t offset_in =
offset;
1049 "failed to find absolute offset of %"PRIX64
" in BodySID %i - partial file?\n",
1050 offset_in, body_sid);
1082 int64_t offset_temp = 0;
1106 av_log(mxf->
fc,
AV_LOG_ERROR,
"IndexSID %i segment at %"PRId64
" missing EditUnitByteCount and IndexEntryArray\n",
1112 *edit_unit_out = edit_unit;
1130 int8_t max_temporal_offset = -128;
1156 for (x = 0; x < index_table->
nb_ptses; x++)
1188 int index_delta = 1;
1197 for (j = 0; j <
n; j += index_delta, x++) {
1203 "x >= nb_ptses - IndexEntryCount %i < IndexDuration %"PRId64
"?\n",
1211 if (index < 0 || index >= index_table->
nb_ptses) {
1213 "index entry %i + TemporalOffset %i = %i, which is out of bounds\n",
1219 max_temporal_offset =
FFMAX(max_temporal_offset, offset);
1223 index_table->
first_dts = -max_temporal_offset;
1234 int i, j, k,
ret, nb_sorted_segments;
1238 nb_sorted_segments <= 0) {
1244 for (i = 0; i < nb_sorted_segments; i++) {
1245 if (i == 0 || sorted_segments[i-1]->index_sid != sorted_segments[i]->index_sid)
1247 else if (sorted_segments[i-1]->body_sid != sorted_segments[i]->body_sid) {
1250 goto finish_decoding_index;
1259 goto finish_decoding_index;
1263 for (i = j = 0; i < nb_sorted_segments; i++) {
1264 if (i != 0 && sorted_segments[i-1]->index_sid != sorted_segments[i]->index_sid) {
1280 " pointer array\n");
1282 goto finish_decoding_index;
1285 if (sorted_segments[i]->index_start_position)
1286 av_log(mxf->
fc,
AV_LOG_WARNING,
"IndexSID %i starts at EditUnit %"PRId64
" - seeking may not work as expected\n",
1294 goto finish_decoding_index;
1302 av_log(mxf->
fc,
AV_LOG_WARNING,
"IndexSID %i segment %i has zero IndexDuration and there's more than one segment\n",
1319 finish_decoding_index:
1350 if (material_package)
break;
1352 if (!material_package) {
1365 UID *essence_container_ul = NULL;
1415 source_package = temp_package;
1419 if (!source_package) {
1420 av_dlog(mxf->
fc,
"material track %d: no corresponding source package found\n", material_track->
track_id);
1430 source_track = temp_track;
1434 if (!source_track) {
1439 if (!source_track || !component)
1470 "Invalid edit rate (%d/%d) found on stream #%d, "
1471 "defaulting to 25/1\n",
1491 if (!sub_descriptor) {
1496 descriptor = sub_descriptor;
1517 essence_container_ul = &((
MXFCryptoContext *)metadata)->source_container_ul;
1528 for (k = 0; k < 16; k++) {
1531 if (!(k+1 & 19) || k == 5)
1538 container_ul =
mxf_get_codec_ul(mxf_picture_essence_container_uls, essence_container_ul);
1569 "Field dominance %d support",
1598 container_ul =
mxf_get_codec_ul(mxf_sound_essence_container_uls, essence_container_ul);
1610 "found for stream #%d, time base forced to 1/48000\n",
1663 buf_size = size + size/2 + 1;
1683 for (i = 0; i <
sizeof(
UID); i++) {
1684 snprintf(p, 2 + 1,
"%.2x", uid[i]);
1686 if (i == 3 || i == 5 || i == 7 || i == 9) {
1696 struct tm time = {0};
1697 time.tm_year = (timestamp >> 48) - 1900;
1698 time.tm_mon = (timestamp >> 40 & 0xFF) - 1;
1699 time.tm_mday = (timestamp >> 32 & 0xFF);
1700 time.tm_hour = (timestamp >> 24 & 0xFF);
1701 time.tm_min = (timestamp >> 16 & 0xFF);
1702 time.tm_sec = (timestamp >> 8 & 0xFF);
1705 time.tm_mon =
FFMAX(time.tm_mon, 0);
1706 time.tm_mday =
FFMAX(time.tm_mday, 1);
1711 strftime(*str, 32,
"%Y-%m-%d %H:%M:%S", &time);
1716 #define SET_STR_METADATA(pb, name, str) do { \
1717 if ((ret = mxf_read_utf16_string(pb, size, &str)) < 0) \
1719 av_dict_set(&s->metadata, name, str, AV_DICT_DONT_STRDUP_VAL); \
1722 #define SET_UID_METADATA(pb, name, var, str) do { \
1723 avio_read(pb, var, 16); \
1724 if ((ret = mxf_uid_to_str(var, &str)) < 0) \
1726 av_dict_set(&s->metadata, name, str, AV_DICT_DONT_STRDUP_VAL); \
1729 #define SET_TS_METADATA(pb, name, var, str) do { \
1730 var = avio_rb64(pb); \
1731 if ((ret = mxf_timestamp_to_str(var, &str)) < 0) \
1733 av_dict_set(&s->metadata, name, str, AV_DICT_DONT_STRDUP_VAL); \
1774 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x05,0x01,0x00 },
mxf_read_primer_pack },
1775 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x01,0x00 },
mxf_read_partition_pack },
1776 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x02,0x00 },
mxf_read_partition_pack },
1777 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x03,0x00 },
mxf_read_partition_pack },
1778 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x04,0x00 },
mxf_read_partition_pack },
1779 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x01,0x00 },
mxf_read_partition_pack },
1780 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x02,0x00 },
mxf_read_partition_pack },
1781 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x03,0x00 },
mxf_read_partition_pack },
1782 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x04,0x00 },
mxf_read_partition_pack },
1783 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x02,0x00 },
mxf_read_partition_pack },
1784 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x04,0x00 },
mxf_read_partition_pack },
1785 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0D,0x01,0x01,0x01,0x01,0x01,0x30,0x00 },
mxf_read_identification_metadata },
1786 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x18,0x00 },
mxf_read_content_storage, 0,
AnyType },
1787 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x37,0x00 },
mxf_read_source_package,
sizeof(
MXFPackage),
SourcePackage },
1788 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x36,0x00 },
mxf_read_material_package,
sizeof(
MXFPackage),
MaterialPackage },
1789 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x0F,0x00 },
mxf_read_sequence,
sizeof(
MXFSequence),
Sequence },
1790 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x11,0x00 },
mxf_read_source_clip,
sizeof(
MXFStructuralComponent),
SourceClip },
1791 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x44,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
MultipleDescriptor },
1792 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x42,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1793 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x28,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1794 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x29,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1795 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x51,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1796 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1797 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x47,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1798 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3A,0x00 },
mxf_read_track,
sizeof(
MXFTrack),
Track },
1799 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3B,0x00 },
mxf_read_track,
sizeof(
MXFTrack),
Track },
1800 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x14,0x00 },
mxf_read_timecode_component,
sizeof(
MXFTimecodeComponent),
TimecodeComponent },
1801 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x04,0x01,0x02,0x02,0x00,0x00 },
mxf_read_cryptographic_context,
sizeof(
MXFCryptoContext),
CryptoContext },
1802 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x10,0x01,0x00 },
mxf_read_index_table_segment,
sizeof(
MXFIndexTableSegment),
IndexTableSegment },
1803 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, NULL, 0,
AnyType },
1821 av_dlog(mxf->
fc,
"local tag %#04x size %d\n", tag, size);
1830 if (local_tag == tag) {
1832 av_dlog(mxf->
fc,
"local tag %#04x\n", local_tag);
1837 if (ctx_size && tag == 0x3C0A)
1839 else if ((ret = read_child(ctx, pb, tag, size, uid, -1)) < 0)
1849 "local tag %#04x extends past end of local set @ %#"PRIx64
"\n",
1875 av_dlog(mxf->
fc,
"seeking to previous partition\n");
1896 av_dlog(mxf->
fc,
"seeking to last partition\n");
1908 av_log(mxf->
fc,
AV_LOG_ERROR,
"failed to seek to last partition @ 0x%"PRIx64
" (%"PRId64
") - partial file?\n",
1909 mxf->
run_in + offset, ret);
1916 av_dlog(mxf->
fc,
"can't find last partition\n");
1959 "partition %i: bad ThisPartition = %"PRIX64
"\n",
1969 int64_t
ret = (position / kag_size) * kag_size;
1970 return ret == position ? ret : ret + kag_size;
2027 klv.
length != length - 20)
2041 int64_t essence_offset = 0;
2042 int64_t last_pos = -1;
2043 uint64_t last_pos_index = 1;
2065 if ((1ULL<<61) % last_pos_index++ == 0)
2093 int64_t op1a_essence_offset =
2111 if (!essence_offset)
2112 essence_offset = klv.
offset;
2128 for (metadata = mxf_metadata_read_table; metadata->
read; metadata++) {
2131 if (klv.
key[5] == 0x53) {
2153 if (!metadata->
read)
2157 if (!essence_offset) {
2175 av_log(mxf->
fc,
AV_LOG_INFO,
"got %i index tables - only the first one (IndexSID %i) will be used\n",
2198 int64_t last_ofs = -1, next_ofs = -1;
2211 if (next_ofs <= last_ofs) {
2215 "next_ofs didn't change. not deriving packet timestamps\n");
2219 if (next_ofs > current_offset)
2222 last_ofs = next_ofs;
2235 int i, total = 0, size = 0;
2242 if ((sample_rate.
num / sample_rate.
den) == 48000)
2245 int remainder = (sample_rate.
num * time_base.
num) % (time_base.
den * sample_rate.
den);
2247 av_mul_q(sample_rate, time_base)));
2250 "seeking detected on stream #%d with time base (%d/%d) and sample rate (%d/%d), audio pts won't be accurate.\n",
2251 stream_index, time_base.
num, time_base.
den, sample_rate.
num, sample_rate.
den);
2302 int64_t next_ofs, next_klv;
2321 if (next_ofs >= 0 && next_klv > next_ofs) {
2325 "OPAtom misinterpreted as OP1a?"
2326 "KLV for edit unit %i extending into "
2333 if (klv.
key[12] == 0x06 && klv.
key[13] == 0x01 && klv.
key[14] == 0x10) {
2380 int64_t ret64, pos, next_pos;
2409 if ((size = next_pos - pos) <= 0) {
2414 if ((ret64 =
avio_seek(s->
pb, pos, SEEK_SET)) < 0)
2501 for (; bufp <
end;) {
2502 if (!((bufp[13] - 1) & 0xF2)){
2535 if (sample_time < 0)
2550 sample_time =
FFMAX(sample_time, 0);
2574 uint64_t current_sample_count = 0;