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));
501 "PreviousPartition equal to ThisPartition %"PRIx64
"\n",
514 "Overriding PreviousPartition with %"PRIx64
"\n",
519 if (footer_partition) {
522 "inconsistent FooterPartition value: %"PRIu64
" != %"PRIu64
"\n",
530 "PartitionPack: ThisPartition = 0x%"PRIX64
531 ", PreviousPartition = 0x%"PRIX64
", "
532 "FooterPartition = 0x%"PRIX64
", IndexSID = %i, BodySID = %i\n",
541 "PreviousPartition points to this partition or forward\n");
545 if (op[12] == 1 && op[13] == 1) mxf->
op =
OP1a;
546 else if (op[12] == 1 && op[13] == 2) mxf->
op =
OP1b;
547 else if (op[12] == 1 && op[13] == 3) mxf->
op =
OP1c;
548 else if (op[12] == 2 && op[13] == 1) mxf->
op =
OP2a;
549 else if (op[12] == 2 && op[13] == 2) mxf->
op =
OP2b;
550 else if (op[12] == 2 && op[13] == 3) mxf->
op =
OP2c;
551 else if (op[12] == 3 && op[13] == 1) mxf->
op =
OP3a;
552 else if (op[12] == 3 && op[13] == 2) mxf->
op =
OP3b;
553 else if (op[12] == 3 && op[13] == 3) mxf->
op =
OP3c;
554 else if (op[12] == 64&& op[13] == 1) mxf->
op =
OPSONYOpt;
555 else if (op[12] == 0x10) {
560 if (nb_essence_containers != 1) {
566 "\"OPAtom\" with %"PRIu32
" ECs - assuming %s\n",
567 nb_essence_containers,
568 op ==
OP1a ?
"OP1a" :
"OPAtom");
574 av_log(mxf->
fc,
AV_LOG_ERROR,
"unknown operational pattern: %02xh %02xh - guessing OP1a\n", op[12], op[13]);
660 package->tracks_refs =
av_calloc(package->tracks_count,
sizeof(
UID));
661 if (!package->tracks_refs)
736 package->tracks_refs =
av_calloc(package->tracks_count,
sizeof(
UID));
737 if (!package->tracks_refs)
748 avio_read(pb, package->descriptor_ref, 16);
794 av_dlog(NULL,
"IndexEntryArray found\n");
816 int code,
value, ofs = 0;
822 av_dlog(NULL,
"pixel layout: code %#x\n", code);
825 layout[ofs++] = code;
826 layout[ofs++] =
value;
922 for (i = 0; i <
len; i++) {
923 if (i != 7 && key[i] != uid[i])
931 while (uls->
uid[0]) {
956 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x04,0x60,0x01 }, 14,
AV_CODEC_ID_MPEG2VIDEO },
957 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x02,0x41,0x01 }, 14,
AV_CODEC_ID_DVVIDEO },
958 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x05,0x00,0x00 }, 14,
AV_CODEC_ID_RAWVIDEO },
959 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,
AV_CODEC_ID_NONE },
964 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x01,0x00,0x00 }, 14,
AV_CODEC_ID_MPEG2VIDEO },
965 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,
AV_CODEC_ID_NONE },
970 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x01,0x32,0x00,0x00 }, 14,
AV_CODEC_ID_H264 },
971 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x04,0x01,0x02,0x02,0x03,0x01,0x01,0x00 }, 14,
AV_CODEC_ID_JPEG2000 },
972 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,
AV_CODEC_ID_NONE },
977 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x06,0x01,0x00 }, 14,
AV_CODEC_ID_PCM_S16LE },
978 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x02,0x0d,0x01,0x03,0x01,0x02,0x04,0x40,0x01 }, 14,
AV_CODEC_ID_MP2 },
979 { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x01,0x01,0x01 }, 14,
AV_CODEC_ID_PCM_S16LE },
980 { { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0xff,0x4b,0x46,0x41,0x41,0x00,0x0d,0x4d,0x4F }, 14,
AV_CODEC_ID_PCM_S16LE },
981 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0,
AV_CODEC_ID_NONE },
986 int i, j, nb_segments = 0;
988 int last_body_sid = -1, last_index_sid = -1, last_index_start = -1;
998 if (!(unsorted_segments =
av_calloc(nb_segments,
sizeof(*unsorted_segments))) ||
999 !(*sorted_segments =
av_calloc(nb_segments,
sizeof(**sorted_segments)))) {
1009 *nb_sorted_segments = 0;
1012 for (i = 0; i < nb_segments; i++) {
1013 int best = -1, best_body_sid = -1, best_index_sid = -1, best_index_start = -1;
1014 uint64_t best_index_duration = 0;
1016 for (j = 0; j < nb_segments; j++) {
1038 (*sorted_segments)[(*nb_sorted_segments)++] = unsorted_segments[best];
1039 last_body_sid = best_body_sid;
1040 last_index_sid = best_index_sid;
1041 last_index_start = best_index_start;
1055 int64_t offset_in =
offset;
1072 "failed to find absolute offset of %"PRIX64
" in BodySID %i - partial file?\n",
1073 offset_in, body_sid);
1105 int64_t offset_temp = 0;
1129 av_log(mxf->
fc,
AV_LOG_ERROR,
"IndexSID %i segment at %"PRId64
" missing EditUnitByteCount and IndexEntryArray\n",
1135 *edit_unit_out = edit_unit;
1153 int8_t max_temporal_offset = -128;
1179 for (x = 0; x < index_table->
nb_ptses; x++)
1211 int index_delta = 1;
1220 for (j = 0; j <
n; j += index_delta, x++) {
1226 "x >= nb_ptses - IndexEntryCount %i < IndexDuration %"PRId64
"?\n",
1234 if (index < 0 || index >= index_table->
nb_ptses) {
1236 "index entry %i + TemporalOffset %i = %i, which is out of bounds\n",
1242 max_temporal_offset =
FFMAX(max_temporal_offset, offset);
1246 index_table->
first_dts = -max_temporal_offset;
1257 int i, j, k,
ret, nb_sorted_segments;
1261 nb_sorted_segments <= 0) {
1267 for (i = 0; i < nb_sorted_segments; i++) {
1268 if (i == 0 || sorted_segments[i-1]->index_sid != sorted_segments[i]->index_sid)
1270 else if (sorted_segments[i-1]->body_sid != sorted_segments[i]->body_sid) {
1273 goto finish_decoding_index;
1282 goto finish_decoding_index;
1286 for (i = j = 0; i < nb_sorted_segments; i++) {
1287 if (i != 0 && sorted_segments[i-1]->index_sid != sorted_segments[i]->index_sid) {
1303 " pointer array\n");
1305 goto finish_decoding_index;
1308 if (sorted_segments[i]->index_start_position)
1309 av_log(mxf->
fc,
AV_LOG_WARNING,
"IndexSID %i starts at EditUnit %"PRId64
" - seeking may not work as expected\n",
1317 goto finish_decoding_index;
1325 av_log(mxf->
fc,
AV_LOG_WARNING,
"IndexSID %i segment %i has zero IndexDuration and there's more than one segment\n",
1342 finish_decoding_index:
1373 if (material_package)
break;
1375 if (!material_package) {
1388 UID *essence_container_ul = NULL;
1438 source_package = temp_package;
1442 if (!source_package) {
1443 av_dlog(mxf->
fc,
"material track %d: no corresponding source package found\n", material_track->
track_id);
1453 source_track = temp_track;
1457 if (!source_track) {
1462 if (!source_track || !component)
1493 "Invalid edit rate (%d/%d) found on stream #%d, "
1494 "defaulting to 25/1\n",
1515 if (!sub_descriptor) {
1520 descriptor = sub_descriptor;
1541 essence_container_ul = &((
MXFCryptoContext *)metadata)->source_container_ul;
1552 for (k = 0; k < 16; k++) {
1555 if (!(k+1 & 19) || k == 5)
1562 container_ul =
mxf_get_codec_ul(mxf_picture_essence_container_uls, essence_container_ul);
1593 "Field dominance %d support",
1622 container_ul =
mxf_get_codec_ul(mxf_sound_essence_container_uls, essence_container_ul);
1634 "found for stream #%d, time base forced to 1/48000\n",
1689 buf_size = size + size / 2 + 1;
1709 for (i = 0; i <
sizeof(
UID); i++) {
1710 snprintf(p, 2 + 1,
"%.2x", uid[i]);
1712 if (i == 3 || i == 5 || i == 7 || i == 9) {
1722 struct tm time = { 0 };
1723 time.tm_year = (timestamp >> 48) - 1900;
1724 time.tm_mon = (timestamp >> 40 & 0xFF) - 1;
1725 time.tm_mday = (timestamp >> 32 & 0xFF);
1726 time.tm_hour = (timestamp >> 24 & 0xFF);
1727 time.tm_min = (timestamp >> 16 & 0xFF);
1728 time.tm_sec = (timestamp >> 8 & 0xFF);
1733 time.tm_mon = av_clip(time.tm_mon, 0, 11);
1734 time.tm_mday = av_clip(time.tm_mday, 1, 31);
1735 time.tm_hour = av_clip(time.tm_hour, 0, 23);
1736 time.tm_min = av_clip(time.tm_min, 0, 59);
1737 time.tm_sec = av_clip(time.tm_sec, 0, 59);
1742 strftime(*str, 32,
"%Y-%m-%d %H:%M:%S", &time);
1747 #define SET_STR_METADATA(pb, name, str) do { \
1748 if ((ret = mxf_read_utf16_string(pb, size, &str)) < 0) \
1750 av_dict_set(&s->metadata, name, str, AV_DICT_DONT_STRDUP_VAL); \
1753 #define SET_UID_METADATA(pb, name, var, str) do { \
1754 avio_read(pb, var, 16); \
1755 if ((ret = mxf_uid_to_str(var, &str)) < 0) \
1757 av_dict_set(&s->metadata, name, str, AV_DICT_DONT_STRDUP_VAL); \
1760 #define SET_TS_METADATA(pb, name, var, str) do { \
1761 var = avio_rb64(pb); \
1762 if ((ret = mxf_timestamp_to_str(var, &str)) < 0) \
1764 av_dict_set(&s->metadata, name, str, AV_DICT_DONT_STRDUP_VAL); \
1805 { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x05,0x01,0x00 },
mxf_read_primer_pack },
1806 { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x01,0x00 },
mxf_read_partition_pack },
1807 { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x02,0x00 },
mxf_read_partition_pack },
1808 { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x03,0x00 },
mxf_read_partition_pack },
1809 { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x02,0x04,0x00 },
mxf_read_partition_pack },
1810 { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x01,0x00 },
mxf_read_partition_pack },
1811 { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x02,0x00 },
mxf_read_partition_pack },
1812 { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x03,0x00 },
mxf_read_partition_pack },
1813 { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x03,0x04,0x00 },
mxf_read_partition_pack },
1814 { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x02,0x00 },
mxf_read_partition_pack },
1815 { { 0x06,0x0e,0x2b,0x34,0x02,0x05,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x04,0x04,0x00 },
mxf_read_partition_pack },
1816 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x30,0x00 },
mxf_read_identification_metadata },
1817 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x18,0x00 },
mxf_read_content_storage, 0,
AnyType },
1818 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x37,0x00 },
mxf_read_source_package,
sizeof(
MXFPackage),
SourcePackage },
1819 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x36,0x00 },
mxf_read_material_package,
sizeof(
MXFPackage),
MaterialPackage },
1820 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x0f,0x00 },
mxf_read_sequence,
sizeof(
MXFSequence),
Sequence },
1821 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x11,0x00 },
mxf_read_source_clip,
sizeof(
MXFStructuralComponent),
SourceClip },
1822 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x44,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
MultipleDescriptor },
1823 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x42,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1824 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x28,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1825 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x29,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1826 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x51,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1827 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1828 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x47,0x00 },
mxf_read_generic_descriptor,
sizeof(
MXFDescriptor),
Descriptor },
1829 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3A,0x00 },
mxf_read_track,
sizeof(
MXFTrack),
Track },
1830 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3B,0x00 },
mxf_read_track,
sizeof(
MXFTrack),
Track },
1831 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x14,0x00 },
mxf_read_timecode_component,
sizeof(
MXFTimecodeComponent),
TimecodeComponent },
1832 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x04,0x01,0x02,0x02,0x00,0x00 },
mxf_read_cryptographic_context,
sizeof(
MXFCryptoContext),
CryptoContext },
1833 { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x10,0x01,0x00 },
mxf_read_index_table_segment,
sizeof(
MXFIndexTableSegment),
IndexTableSegment },
1834 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, NULL, 0,
AnyType },
1852 av_dlog(mxf->
fc,
"local tag %#04x size %d\n", tag, size);
1861 if (local_tag == tag) {
1863 av_dlog(mxf->
fc,
"local tag %#04x\n", local_tag);
1868 if (ctx_size && tag == 0x3C0A)
1870 else if ((ret = read_child(ctx, pb, tag, size, uid, -1)) < 0)
1880 "local tag %#04x extends past end of local set @ %#"PRIx64
"\n",
1906 av_dlog(mxf->
fc,
"seeking to previous partition\n");
1927 av_dlog(mxf->
fc,
"no last partition\n");
1931 av_dlog(mxf->
fc,
"seeking to last partition\n");
1944 "failed to seek to last partition @ 0x%" PRIx64
1945 " (%"PRId64
") - partial file?\n",
1946 mxf->
run_in + offset, ret);
1993 "partition %i: bad ThisPartition = %"PRIX64
"\n",
2003 int64_t
ret = (position / kag_size) * kag_size;
2004 return ret == position ? ret : ret + kag_size;
2061 klv.
length != length - 20)
2075 int64_t essence_offset = 0;
2076 int64_t last_pos = -1;
2077 uint64_t last_pos_index = 1;
2099 if ((1ULL<<61) % last_pos_index++ == 0)
2127 int64_t op1a_essence_offset =
2145 if (!essence_offset)
2146 essence_offset = klv.
offset;
2162 for (metadata = mxf_metadata_read_table; metadata->
read; metadata++) {
2165 if (klv.
key[5] == 0x53) {
2187 if (!metadata->
read)
2191 if (!essence_offset) {
2209 av_log(mxf->
fc,
AV_LOG_INFO,
"got %i index tables - only the first one (IndexSID %i) will be used\n",
2232 int64_t last_ofs = -1, next_ofs = -1;
2245 if (next_ofs <= last_ofs) {
2249 "next_ofs didn't change. not deriving packet timestamps\n");
2253 if (next_ofs > current_offset)
2256 last_ofs = next_ofs;
2268 uint64_t *sample_count)
2270 int i, total = 0, size = 0;
2277 if ((sample_rate.
num / sample_rate.
den) == 48000)
2280 int remainder = (sample_rate.
num * time_base.
num) %
2281 (time_base.
den * sample_rate.
den);
2283 av_mul_q(sample_rate, time_base)));
2286 "seeking detected on stream #%d with time base (%d/%d) and "
2287 "sample rate (%d/%d), audio pts won't be accurate.\n",
2288 stream_index, time_base.
num, time_base.
den,
2289 sample_rate.
num, sample_rate.
den);
2317 || bits_per_sample <= 0
2318 || codec->
channels * (int64_t)bits_per_sample < 8)
2344 int64_t next_ofs, next_klv;
2351 "error getting stream index %"PRIu32
"\n",
2365 if (next_ofs >= 0 && next_klv > next_ofs) {
2369 "OPAtom misinterpreted as OP1a?"
2370 "KLV for edit unit %i extending into "
2377 if (klv.
key[12] == 0x06 && klv.
key[13] == 0x01 && klv.
key[14] == 0x10) {
2428 int64_t ret64, pos, next_pos;
2457 if ((size = next_pos - pos) <= 0) {
2462 if ((ret64 =
avio_seek(s->
pb, pos, SEEK_SET)) < 0)
2549 for (; bufp <
end;) {
2550 if (!((bufp[13] - 1) & 0xF2)){
2584 if (sample_time < 0)
2599 sample_time =
FFMAX(sample_time, 0);
2623 uint64_t current_sample_count = 0;