249 static const uint8_t mxf_header_partition_pack_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02 };
250 static const uint8_t mxf_essence_element_key[] = { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0d,0x01,0x03,0x01 };
251 static const uint8_t mxf_avid_essence_element_key[] = { 0x06,0x0e,0x2b,0x34,0x01,0x02,0x01,0x01,0x0e,0x04,0x03,0x01 };
252 static const uint8_t mxf_system_item_key[] = { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0D,0x01,0x03,0x01,0x04 };
255 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 };
256 static const uint8_t mxf_encrypted_triplet_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x04,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x7e,0x01,0x00 };
257 static const uint8_t mxf_encrypted_essence_container[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0b,0x01,0x00 };
258 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 };
259 static const uint8_t mxf_sony_mpeg4_extradata[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00 };
261 #define IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y)))
267 int bytes_num = size & 0x7f;
273 size = size << 8 |
avio_r8(pb);
281 for (i = 0; i < size && !
url_feof(pb); i++) {
285 else if (b != key[i])
299 return klv->
length == -1 ? -1 : 0;
319 const uint8_t *buf_ptr, *end_ptr;
328 data_ptr = pkt->
data;
330 buf_ptr = pkt->
data + 4;
333 uint32_t
sample = bytestream_get_le32(&buf_ptr);
335 bytestream_put_le24(&data_ptr, (sample >> 4) & 0xffffff);
337 bytestream_put_le16(&data_ptr, (sample >> 12) & 0xffff);
347 static const uint8_t checkv[16] = {0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b};
353 uint64_t plaintext_size;
380 if (orig_size < plaintext_size)
384 if (size < 32 || size - 32 < orig_size)
390 if (memcmp(tmpbuf, checkv, 16))
396 else if (size < plaintext_size)
398 size -= plaintext_size;
401 &pkt->
data[plaintext_size], size >> 4, ivec, 1);
414 if (item_len != 18) {
418 if (item_num > 65536) {
435 uint64_t footer_partition;
436 uint32_t nb_essence_containers;
455 memset(partition, 0,
sizeof(*partition));
494 if (footer_partition) {
497 "inconsistent FooterPartition value: %"PRIu64
" != %"PRIu64
"\n",
505 "PartitionPack: ThisPartition = 0x%"PRIX64
506 ", PreviousPartition = 0x%"PRIX64
", "
507 "FooterPartition = 0x%"PRIX64
", IndexSID = %i, BodySID = %i\n",
516 "PreviousPartition points to this partition or forward\n");
520 if (op[12] == 1 && op[13] == 1) mxf->
op =
OP1a;
521 else if (op[12] == 1 && op[13] == 2) mxf->
op =
OP1b;
522 else if (op[12] == 1 && op[13] == 3) mxf->
op =
OP1c;
523 else if (op[12] == 2 && op[13] == 1) mxf->
op =
OP2a;
524 else if (op[12] == 2 && op[13] == 2) mxf->
op =
OP2b;
525 else if (op[12] == 2 && op[13] == 3) mxf->
op =
OP2c;
526 else if (op[12] == 3 && op[13] == 1) mxf->
op =
OP3a;
527 else if (op[12] == 3 && op[13] == 2) mxf->
op =
OP3b;
528 else if (op[12] == 3 && op[13] == 3) mxf->
op =
OP3c;
529 else if (op[12] == 64&& op[13] == 1) mxf->
op =
OPSONYOpt;
530 else if (op[12] == 0x10) {
535 if (nb_essence_containers != 1) {
541 nb_essence_containers, op ==
OP1a ?
"OP1a" :
"OPAtom");
547 av_log(mxf->
fc,
AV_LOG_ERROR,
"unknown operational pattern: %02xh %02xh - guessing OP1a\n", op[12], op[13]);
632 package->tracks_refs =
av_calloc(package->tracks_count,
sizeof(
UID));
633 if (!package->tracks_refs)
708 package->tracks_refs =
av_calloc(package->tracks_count,
sizeof(
UID));
709 if (!package->tracks_refs)
720 avio_read(pb, package->descriptor_ref, 16);
766 av_dlog(NULL,
"IndexEntryArray found\n");
788 int code,
value, ofs = 0;
794 av_dlog(NULL,
"pixel layout: code %#x\n", code);
797 layout[ofs++] = code;
798 layout[ofs++] =
value;
894 for (i = 0; i <
len; i++) {
895 if (i != 7 && key[i] != uid[i])
903 while (uls->
uid[0]) {
928 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 14,
AV_CODEC_ID_MPEG2VIDEO },
929 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 14,
AV_CODEC_ID_DVVIDEO },
930 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x05,0x00,0x00 }, 14,
AV_CODEC_ID_RAWVIDEO },
931 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,
AV_CODEC_ID_NONE },
936 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x00,0x00 }, 14,
AV_CODEC_ID_MPEG2VIDEO },
937 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,
AV_CODEC_ID_NONE },
942 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x01,0x32,0x00,0x00 }, 14,
AV_CODEC_ID_H264 },
943 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x07,0x04,0x01,0x02,0x02,0x03,0x01,0x01,0x00 }, 14,
AV_CODEC_ID_JPEG2000 },
944 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,
AV_CODEC_ID_NONE },
949 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 14,
AV_CODEC_ID_PCM_S16LE },
950 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x02,0x0D,0x01,0x03,0x01,0x02,0x04,0x40,0x01 }, 14,
AV_CODEC_ID_MP2 },
951 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x01,0x01 }, 14,
AV_CODEC_ID_PCM_S16LE },
952 { { 0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0xFF,0x4B,0x46,0x41,0x41,0x00,0x0D,0x4D,0x4F }, 14,
AV_CODEC_ID_PCM_S16LE },
953 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,
AV_CODEC_ID_NONE },
958 int i, j, nb_segments = 0;
960 int last_body_sid = -1, last_index_sid = -1, last_index_start = -1;
970 if (!(unsorted_segments =
av_calloc(nb_segments,
sizeof(*unsorted_segments))) ||
971 !(*sorted_segments =
av_calloc(nb_segments,
sizeof(**sorted_segments)))) {
981 *nb_sorted_segments = 0;
984 for (i = 0; i < nb_segments; i++) {
985 int best = -1, best_body_sid = -1, best_index_sid = -1, best_index_start = -1;
986 uint64_t best_index_duration = 0;
988 for (j = 0; j < nb_segments; j++) {
1010 (*sorted_segments)[(*nb_sorted_segments)++] = unsorted_segments[best];
1011 last_body_sid = best_body_sid;
1012 last_index_sid = best_index_sid;
1013 last_index_start = best_index_start;
1027 int64_t offset_in =
offset;
1044 "failed to find absolute offset of %"PRIX64
" in BodySID %i - partial file?\n",
1045 offset_in, body_sid);
1077 int64_t offset_temp = 0;
1101 av_log(mxf->
fc,
AV_LOG_ERROR,
"IndexSID %i segment at %"PRId64
" missing EditUnitByteCount and IndexEntryArray\n",
1107 *edit_unit_out = edit_unit;
1125 int8_t max_temporal_offset = -128;
1151 for (x = 0; x < index_table->
nb_ptses; x++)
1183 int index_delta = 1;
1192 for (j = 0; j <
n; j += index_delta, x++) {
1198 "x >= nb_ptses - IndexEntryCount %i < IndexDuration %"PRId64
"?\n",
1206 if (index < 0 || index >= index_table->
nb_ptses) {
1208 "index entry %i + TemporalOffset %i = %i, which is out of bounds\n",
1214 max_temporal_offset =
FFMAX(max_temporal_offset, offset);
1218 index_table->
first_dts = -max_temporal_offset;
1229 int i, j, k,
ret, nb_sorted_segments;
1233 nb_sorted_segments <= 0) {
1239 for (i = 0; i < nb_sorted_segments; i++) {
1240 if (i == 0 || sorted_segments[i-1]->index_sid != sorted_segments[i]->index_sid)
1242 else if (sorted_segments[i-1]->body_sid != sorted_segments[i]->body_sid) {
1245 goto finish_decoding_index;
1252 goto finish_decoding_index;
1256 for (i = j = 0; i < nb_sorted_segments; i++) {
1257 if (i != 0 && sorted_segments[i-1]->index_sid != sorted_segments[i]->index_sid) {
1271 goto finish_decoding_index;
1274 if (sorted_segments[i]->index_start_position)
1275 av_log(mxf->
fc,
AV_LOG_WARNING,
"IndexSID %i starts at EditUnit %"PRId64
" - seeking may not work as expected\n",
1283 goto finish_decoding_index;
1291 av_log(mxf->
fc,
AV_LOG_WARNING,
"IndexSID %i segment %i has zero IndexDuration and there's more than one segment\n",
1308 finish_decoding_index:
1339 if (material_package)
break;
1341 if (!material_package) {
1354 UID *essence_container_ul = NULL;
1404 source_package = temp_package;
1408 if (!source_package) {
1409 av_dlog(mxf->
fc,
"material track %d: no corresponding source package found\n", material_track->
track_id);
1419 source_track = temp_track;
1423 if (!source_track) {
1428 if (!source_track || !component)
1458 "invalid edit rate (%d/%d) found on stream #%d, defaulting to 25/1\n",
1477 if (!sub_descriptor) {
1482 descriptor = sub_descriptor;
1503 essence_container_ul = &((
MXFCryptoContext *)metadata)->source_container_ul;
1514 for (k = 0; k < 16; k++) {
1517 if (!(k+1 & 19) || k == 5)
1523 container_ul =
mxf_get_codec_ul(mxf_picture_essence_container_uls, essence_container_ul);
1569 container_ul =
mxf_get_codec_ul(mxf_sound_essence_container_uls, essence_container_ul);
1581 "found for stream #%d, time base forced to 1/48000\n",
1632 buf_size = size + size/2 + 1;
1652 for (i = 0; i <
sizeof(
UID); i++) {
1653 snprintf(p, 2 + 1,
"%.2x", uid[i]);
1655 if (i == 3 || i == 5 || i == 7 || i == 9) {
1665 struct tm time = {0};
1666 time.tm_year = (timestamp >> 48) - 1900;
1667 time.tm_mon = (timestamp >> 40 & 0xFF) - 1;
1668 time.tm_mday = (timestamp >> 32 & 0xFF);
1669 time.tm_hour = (timestamp >> 24 & 0xFF);
1670 time.tm_min = (timestamp >> 16 & 0xFF);
1671 time.tm_sec = (timestamp >> 8 & 0xFF);
1674 time.tm_mon =
FFMAX(time.tm_mon, 0);
1675 time.tm_mday =
FFMAX(time.tm_mday, 1);
1680 strftime(*str, 32,
"%Y-%m-%d %H:%M:%S", &time);
1685 #define SET_STR_METADATA(pb, name, str) do { \
1686 if ((ret = mxf_read_utf16_string(pb, size, &str)) < 0) \
1688 av_dict_set(&s->metadata, name, str, AV_DICT_DONT_STRDUP_VAL); \
1691 #define SET_UID_METADATA(pb, name, var, str) do { \
1692 avio_read(pb, var, 16); \
1693 if ((ret = mxf_uid_to_str(var, &str)) < 0) \
1695 av_dict_set(&s->metadata, name, str, AV_DICT_DONT_STRDUP_VAL); \
1698 #define SET_TS_METADATA(pb, name, var, str) do { \
1699 var = avio_rb64(pb); \
1700 if ((ret = mxf_timestamp_to_str(var, &str)) < 0) \
1702 av_dict_set(&s->metadata, name, str, AV_DICT_DONT_STRDUP_VAL); \
1743 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x05,0x01,0x00 },
mxf_read_primer_pack },
1744 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x01,0x00 },
mxf_read_partition_pack },
1745 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x02,0x00 },
mxf_read_partition_pack },
1746 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x03,0x00 },
mxf_read_partition_pack },
1747 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x04,0x00 },
mxf_read_partition_pack },
1748 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x01,0x00 },
mxf_read_partition_pack },
1749 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x02,0x00 },
mxf_read_partition_pack },
1750 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x03,0x00 },
mxf_read_partition_pack },
1751 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x04,0x00 },
mxf_read_partition_pack },
1752 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x02,0x00 },
mxf_read_partition_pack },
1753 { { 0x06,0x0E,0x2B,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x04,0x00 },
mxf_read_partition_pack },
1754 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0D,0x01,0x01,0x01,0x01,0x01,0x30,0x00 },
mxf_read_identification_metadata },
1755 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x18,0x00 },
mxf_read_content_storage, 0,
AnyType },
1756 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x37,0x00 },
mxf_read_source_package,
sizeof(
MXFPackage),
SourcePackage },
1757 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x36,0x00 },
mxf_read_material_package,
sizeof(
MXFPackage),
MaterialPackage },
1758 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x0F,0x00 },
mxf_read_sequence,
sizeof(
MXFSequence),
Sequence },
1759 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x11,0x00 },
mxf_read_source_clip,
sizeof(
MXFStructuralComponent),
SourceClip },
1760 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x44,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
MultipleDescriptor },
1761 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x42,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1762 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x28,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1763 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x29,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1764 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x51,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1765 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1766 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x47,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1767 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3A,0x00 },
mxf_read_track,
sizeof(
MXFTrack),
Track },
1768 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3B,0x00 },
mxf_read_track,
sizeof(
MXFTrack),
Track },
1769 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x14,0x00 },
mxf_read_timecode_component,
sizeof(
MXFTimecodeComponent),
TimecodeComponent },
1770 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x04,0x01,0x02,0x02,0x00,0x00 },
mxf_read_cryptographic_context,
sizeof(
MXFCryptoContext),
CryptoContext },
1771 { { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x10,0x01,0x00 },
mxf_read_index_table_segment,
sizeof(
MXFIndexTableSegment),
IndexTableSegment },
1772 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, NULL, 0,
AnyType },
1790 av_dlog(mxf->
fc,
"local tag %#04x size %d\n", tag, size);
1799 if (local_tag == tag) {
1801 av_dlog(mxf->
fc,
"local tag %#04x\n", local_tag);
1806 if (ctx_size && tag == 0x3C0A)
1808 else if ((ret = read_child(ctx, pb, tag, size, uid, -1)) < 0)
1818 "local tag %#04x extends past end of local set @ %#"PRIx64
"\n",
1824 if (ctx_size) ctx->
type = type;
1844 av_dlog(mxf->
fc,
"seeking to previous partition\n");
1865 av_dlog(mxf->
fc,
"seeking to last partition\n");
1877 av_log(mxf->
fc,
AV_LOG_ERROR,
"failed to seek to last partition @ 0x%"PRIx64
" (%"PRId64
") - partial file?\n",
1878 mxf->
run_in + offset, ret);
1885 av_dlog(mxf->
fc,
"can't find last partition\n");
1928 "partition %i: bad ThisPartition = %"PRIX64
"\n",
1938 int64_t
ret = (position / kag_size) * kag_size;
1939 return ret == position ? ret : ret + kag_size;
1991 if (length <= 32 || length >=
FFMIN(file_size, INT_MAX))
1996 klv.
length != length - 20)
2010 int64_t essence_offset = 0;
2011 int64_t last_pos = -1;
2012 uint64_t last_pos_index = 1;
2034 if ((1ULL<<61) % last_pos_index++ == 0)
2062 int64_t op1a_essence_offset =
2080 if (!essence_offset)
2081 essence_offset = klv.
offset;
2097 for (metadata = mxf_metadata_read_table; metadata->
read; metadata++) {
2100 if (klv.
key[5] == 0x53) {
2122 if (!metadata->
read)
2126 if (!essence_offset) {
2144 av_log(mxf->
fc,
AV_LOG_INFO,
"got %i index tables - only the first one (IndexSID %i) will be used\n",
2167 int64_t last_ofs = -1, next_ofs = -1;
2180 if (next_ofs <= last_ofs) {
2184 "next_ofs didn't change. not deriving packet timestamps\n");
2188 if (next_ofs > current_offset)
2191 last_ofs = next_ofs;
2204 int i, total = 0, size = 0;
2211 if ((sample_rate.
num / sample_rate.
den) == 48000)
2214 int remainder = (sample_rate.
num * time_base.
num) % (time_base.
den * sample_rate.
den);
2216 av_mul_q(sample_rate, time_base)));
2219 "seeking detected on stream #%d with time base (%d/%d) and sample rate (%d/%d), audio pts won't be accurate.\n",
2220 stream_index, time_base.
num, time_base.
den, sample_rate.
num, sample_rate.
den);
2271 int64_t next_ofs, next_klv;
2290 if (next_ofs >= 0 && next_klv > next_ofs) {
2294 "OPAtom misinterpreted as OP1a?"
2295 "KLV for edit unit %i extending into "
2302 if (klv.
key[12] == 0x06 && klv.
key[13] == 0x01 && klv.
key[14] == 0x10) {
2349 int64_t ret64, pos, next_pos;
2378 if ((size = next_pos - pos) <= 0) {
2383 if ((ret64 =
avio_seek(s->
pb, pos, SEEK_SET)) < 0)
2469 for (; bufp <
end; bufp++) {
2496 if (sample_time < 0)
2509 sample_time =
FFMAX(sample_time, 0);
2533 uint64_t current_sample_count = 0;