69 unsigned len,
const char *key)
73 short current, total = 0;
79 snprintf(buf,
sizeof(buf),
"%d", current);
81 snprintf(buf,
sizeof(buf),
"%d/%d", current, total);
88 unsigned len,
const char *key)
104 unsigned len,
const char *key)
115 unsigned len,
const char *key)
133 char key[1024]={0},
data[1024]={0};
143 if (atom.
size <= 8)
return 0;
145 for (i = 0; i < 3; i++) {
148 int str_size = 0, skip_size = 0;
152 case MKTAG(
'n',
'a',
'm',
'e'):
154 str_size = skip_size = data_size - 12;
158 case MKTAG(
'd',
'a',
't',
'a'):
161 str_size = skip_size = data_size - 16;
166 skip_size = data_size - 8;
174 target[str_size] = 0;
176 atom.
size -= skip_size;
179 if (skip_size > str_size)
avio_skip(pb, skip_size - str_size);
183 if (strcmp(key,
"iTunSMPB") == 0) {
184 int priming, remainder, samples;
185 if(sscanf(
data,
"%*X %X %X %X", &priming, &remainder, &samples) == 3){
186 if(priming>0 && priming<16384)
191 if (strcmp(key,
"cdec") == 0) {
200 0x00C4,0x00C5,0x00C7,0x00C9,0x00D1,0x00D6,0x00DC,0x00E1,
201 0x00E0,0x00E2,0x00E4,0x00E3,0x00E5,0x00E7,0x00E9,0x00E8,
202 0x00EA,0x00EB,0x00ED,0x00EC,0x00EE,0x00EF,0x00F1,0x00F3,
203 0x00F2,0x00F4,0x00F6,0x00F5,0x00FA,0x00F9,0x00FB,0x00FC,
204 0x2020,0x00B0,0x00A2,0x00A3,0x00A7,0x2022,0x00B6,0x00DF,
205 0x00AE,0x00A9,0x2122,0x00B4,0x00A8,0x2260,0x00C6,0x00D8,
206 0x221E,0x00B1,0x2264,0x2265,0x00A5,0x00B5,0x2202,0x2211,
207 0x220F,0x03C0,0x222B,0x00AA,0x00BA,0x03A9,0x00E6,0x00F8,
208 0x00BF,0x00A1,0x00AC,0x221A,0x0192,0x2248,0x2206,0x00AB,
209 0x00BB,0x2026,0x00A0,0x00C0,0x00C3,0x00D5,0x0152,0x0153,
210 0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA,
211 0x00FF,0x0178,0x2044,0x20AC,0x2039,0x203A,0xFB01,0xFB02,
212 0x2021,0x00B7,0x201A,0x201E,0x2030,0x00C2,0x00CA,0x00C1,
213 0x00CB,0x00C8,0x00CD,0x00CE,0x00CF,0x00CC,0x00D3,0x00D4,
214 0xF8FF,0x00D2,0x00DA,0x00DB,0x00D9,0x0131,0x02C6,0x02DC,
215 0x00AF,0x02D8,0x02D9,0x02DA,0x00B8,0x02DD,0x02DB,0x02C7,
219 char *dst,
int dstlen)
222 char *
end = dst+dstlen-1;
225 for (i = 0; i <
len; i++) {
227 if (c < 0x80 && p < end)
279 unsigned len,
const char *key)
291 #ifdef MOV_EXPORT_ALL_METADATA
294 char str[1024], key2[16], language[4] = {0};
295 const char *key = NULL;
296 uint16_t langcode = 0;
297 uint32_t data_type = 0, str_size;
304 case MKTAG(0xa9,
'n',
'a',
'm'): key =
"title";
break;
305 case MKTAG(0xa9,
'a',
'u',
't'):
306 case MKTAG(0xa9,
'A',
'R',
'T'): key =
"artist";
break;
307 case MKTAG(
'a',
'A',
'R',
'T'): key =
"album_artist";
break;
308 case MKTAG(0xa9,
'w',
'r',
't'): key =
"composer";
break;
309 case MKTAG(
'c',
'p',
'r',
't'):
310 case MKTAG(0xa9,
'c',
'p',
'y'): key =
"copyright";
break;
311 case MKTAG(0xa9,
'g',
'r',
'p'): key =
"grouping";
break;
312 case MKTAG(0xa9,
'l',
'y',
'r'): key =
"lyrics";
break;
313 case MKTAG(0xa9,
'c',
'm',
't'):
314 case MKTAG(0xa9,
'i',
'n',
'f'): key =
"comment";
break;
315 case MKTAG(0xa9,
'a',
'l',
'b'): key =
"album";
break;
316 case MKTAG(0xa9,
'd',
'a',
'y'): key =
"date";
break;
317 case MKTAG(0xa9,
'g',
'e',
'n'): key =
"genre";
break;
318 case MKTAG(
'g',
'n',
'r',
'e'): key =
"genre";
320 case MKTAG(0xa9,
't',
'o',
'o'):
321 case MKTAG(0xa9,
's',
'w',
'r'): key =
"encoder";
break;
322 case MKTAG(0xa9,
'e',
'n',
'c'): key =
"encoder";
break;
323 case MKTAG(0xa9,
'm',
'a',
'k'): key =
"make";
break;
324 case MKTAG(0xa9,
'm',
'o',
'd'): key =
"model";
break;
325 case MKTAG(0xa9,
'x',
'y',
'z'): key =
"location";
break;
326 case MKTAG(
'd',
'e',
's',
'c'): key =
"description";
break;
327 case MKTAG(
'l',
'd',
'e',
's'): key =
"synopsis";
break;
328 case MKTAG(
't',
'v',
's',
'h'): key =
"show";
break;
329 case MKTAG(
't',
'v',
'e',
'n'): key =
"episode_id";
break;
330 case MKTAG(
't',
'v',
'n',
'n'): key =
"network";
break;
331 case MKTAG(
't',
'r',
'k',
'n'): key =
"track";
333 case MKTAG(
'd',
'i',
's',
'k'): key =
"disc";
335 case MKTAG(
't',
'v',
'e',
's'): key =
"episode_sort";
337 case MKTAG(
't',
'v',
's',
'n'): key =
"season_number";
339 case MKTAG(
's',
't',
'i',
'k'): key =
"media_type";
341 case MKTAG(
'h',
'd',
'v',
'd'): key =
"hd_video";
343 case MKTAG(
'p',
'g',
'a',
'p'): key =
"gapless_playback";
345 case MKTAG(
'@',
'P',
'R',
'M'):
347 case MKTAG(
'@',
'P',
'R',
'Q'):
354 if (tag ==
MKTAG(
'd',
'a',
't',
'a')) {
357 str_size = data_size - 16;
360 if (atom.
type ==
MKTAG(
'c',
'o',
'v',
'r')) {
374 str_size = atom.
size;
376 #ifdef MOV_EXPORT_ALL_METADATA
388 str_size =
FFMIN3(
sizeof(str)-1, str_size, atom.
size);
391 parse(c, pb, str_size, key);
393 if (data_type == 3 || (data_type == 0 && (langcode < 0x400 || langcode == 0x7fff))) {
400 if (*language && strcmp(language,
"und")) {
401 snprintf(key2,
sizeof(key2),
"%s-%s", key, language);
405 av_dlog(c->
fc,
"lang \"%3s\" ", language);
406 av_dlog(c->
fc,
"tag \"%s\" value \"%s\" atom \"%.4s\" %d %"PRId64
"\n",
407 key, str, (
char*)&atom.
type, str_size, atom.
size);
415 int i, nb_chapters, str_len,
version;
418 if ((atom.
size -= 5) < 0)
427 for (i = 0; i < nb_chapters; i++) {
434 if ((atom.
size -= 9+str_len) < 0)
444 #define MIN_DATA_ENTRY_BOX_SIZE 12
459 entries >= UINT_MAX /
sizeof(*sc->
drefs))
478 av_dlog(c->
fc,
"type %.4s size %d\n", (
char*)&dref->
type, size);
480 if (dref->
type ==
MKTAG(
'a',
'l',
'i',
's') && size > 150) {
482 uint16_t volume_len,
len;
488 volume_len =
FFMIN(volume_len, 27);
490 dref->
volume[volume_len] = 0;
496 len =
FFMIN(len, 63);
511 for (type = 0; type != -1 &&
avio_tell(pb) < next; ) {
525 if (len > volume_len && !strncmp(dref->
path, dref->
volume, volume_len)) {
527 memmove(dref->
path, dref->
path+volume_len, len);
530 for (j = 0; j <
len; j++)
531 if (dref->
path[j] ==
':')
534 }
else if (type == 0) {
541 for (j = 0; j <
len; j++)
542 if (dref->
dir[j] ==
':')
574 av_dlog(c->
fc,
"ctype= %.4s (0x%08x)\n", (
char*)&ctype, ctype);
575 av_dlog(c->
fc,
"stype= %.4s\n", (
char*)&type);
577 if (type ==
MKTAG(
'v',
'i',
'd',
'e'))
579 else if (type ==
MKTAG(
's',
'o',
'u',
'n'))
581 else if (type ==
MKTAG(
'm',
'1',
'a',
' '))
583 else if ((type ==
MKTAG(
's',
'u',
'b',
'p')) || (type ==
MKTAG(
'c',
'l',
'c',
'p')))
590 title_size = atom.
size - 24;
591 if (title_size > 0) {
596 title_str[title_size] = 0;
599 (!c->
isom && title_str[0] == title_size - 1), 0);
636 int ac3info, acmod, lfeon, bsmod;
643 bsmod = (ac3info >> 14) & 0x7;
644 acmod = (ac3info >> 11) & 0x7;
645 lfeon = (ac3info >> 10) & 0x1;
646 st->
codec->
channels = ((
int[]){2,1,2,3,3,4,4,5})[acmod] + lfeon;
660 int eac3info, acmod, lfeon, bsmod;
671 bsmod = (eac3info >> 12) & 0x1f;
672 acmod = (eac3info >> 9) & 0x7;
673 lfeon = (eac3info >> 8) & 0x1;
732 "sample aspect ratio already set to %d:%d, ignoring 'pasp' atom (%d:%d)\n",
735 }
else if (den != 0) {
756 char minor_ver_str[11];
757 char* comp_brands_str;
761 if (strcmp(type,
"qt "))
766 snprintf(minor_ver_str,
sizeof(minor_ver_str),
"%d", minor_ver);
769 comp_brand_size = atom.
size - 8;
770 if (comp_brand_size < 0)
772 comp_brands_str =
av_malloc(comp_brand_size + 1);
773 if (!comp_brands_str)
775 avio_read(pb, comp_brands_str, comp_brand_size);
776 comp_brands_str[comp_brand_size] = 0;
809 if(time >= 2082844800)
812 ptm = gmtime(&timet);
814 strftime(buffer,
sizeof(buffer),
"%Y-%m-%d %H:%M:%S", ptm);
824 char language[4] = {0};
826 int64_t creation_time;
861 int64_t creation_time;
910 av_dlog(c->
fc,
"enda %d\n", little_endian);
911 if (little_endian == 1) {
935 unsigned mov_field_order;
944 if ((mov_field_order & 0xFF00) == 0x0100)
946 else if ((mov_field_order & 0xFF00) == 0x0200) {
947 switch (mov_field_order & 0xFF) {
982 if (size > INT_MAX || (uint64_t)atom.
size > INT_MAX)
1026 codec->
width = 1440;
1046 if ((uint64_t)atom.
size > (1<<30))
1060 }
else if (atom.
size > 8) {
1081 if ((uint64_t)atom.
size > (1<<30))
1084 if (atom.
size >= 10) {
1090 if (type ==
MKTAG(
'f',
'i',
'e',
'l') && size == atom.
size)
1112 if (atom.
size >= (1<<28) || atom.
size < 7)
1116 if ((profile_level & 0xf0) != 0xc0)
1141 if (atom.
size <= 40)
1145 if ((uint64_t)atom.
size > (1<<30))
1163 unsigned int i, entries;
1177 if (entries >= UINT_MAX/
sizeof(int64_t))
1185 if (atom.
type ==
MKTAG(
's',
't',
'c',
'o'))
1188 else if (atom.
type ==
MKTAG(
'c',
'o',
'6',
'4'))
1220 int j, pseudo_stream_id;
1227 for (pseudo_stream_id = 0;
1229 pseudo_stream_id++) {
1242 }
else if (size <= 7){
1267 if (
id<=0 && ((format&0xFFFF) ==
'm'+(
's'<<8) || (format&0xFFFF) ==
'T'+(
'S'<<8)))
1273 format && format !=
MKTAG(
'm',
'p',
'4',
's')) {
1288 av_dlog(c->
fc,
"size=%"PRId64
" 4CC= %c%c%c%c codec_type=%d\n", size,
1289 (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff,
1293 unsigned int color_depth,
len;
1294 int color_greyscale;
1325 if (format ==
MKTAG(
'H',
'2',
'6',
'3') &&
1331 av_dlog(c->
fc,
"depth %d, ctab id %d\n",
1338 if ((color_depth == 2) || (color_depth == 4) ||
1339 (color_depth == 8)) {
1341 unsigned int color_start, color_count, color_end;
1342 unsigned char a,
r,
g,
b;
1344 if (color_greyscale) {
1345 int color_index, color_dec;
1348 color_count = 1 << color_depth;
1350 color_dec = 256 / (color_count - 1);
1351 for (j = 0; j < color_count; j++) {
1353 r = g = b = color_count - 1 - color_index;
1355 r = g = b = color_index;
1357 (0xFF
U << 24) | (r << 16) | (g << 8) | (b);
1358 color_index -= color_dec;
1359 if (color_index < 0)
1362 }
else if (color_table_id) {
1365 color_count = 1 << color_depth;
1366 if (color_depth == 2)
1368 else if (color_depth == 4)
1373 for (j = 0; j < color_count; j++) {
1374 r = color_table[j * 3 + 0];
1375 g = color_table[j * 3 + 1];
1376 b = color_table[j * 3 + 2];
1378 (0xFF
U << 24) | (r << 16) | (g << 8) | (b);
1385 if ((color_start <= 255) &&
1386 (color_end <= 255)) {
1387 for (j = color_start; j <= color_end; j++) {
1399 (a << 24 ) | (r << 16) | (g << 8) | (b);
1406 int bits_per_sample,
flags;
1426 (compatible_brands && strstr(compatible_brands->
value,
"qt "))) {
1432 }
else if (version==2) {
1441 if (format ==
MKTAG(
'l',
'p',
'c',
'm'))
1483 if (bits_per_sample) {
1491 if (format !=
AV_RL32(
"mp4s"))
1519 }
else if (a.
size > 0)
1531 #if CONFIG_DV_DEMUXER
1610 unsigned int i, entries;
1626 if (entries >= UINT_MAX /
sizeof(*sc->
stsc_data))
1632 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1650 unsigned i, entries;
1660 if (entries >= UINT_MAX /
sizeof(*sc->
stps_data))
1666 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1683 unsigned int i, entries;
1695 av_dlog(c->
fc,
"keyframe_count = %d\n", entries);
1702 if (entries >= UINT_MAX /
sizeof(
int))
1708 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1725 unsigned int i, entries, sample_size, field_size, num_bytes;
1737 if (atom.
type ==
MKTAG(
's',
't',
's',
'z')) {
1756 if (field_size != 4 && field_size != 8 && field_size != 16 && field_size != 32) {
1763 if (entries >= UINT_MAX /
sizeof(
int) || entries >= (UINT_MAX - 4) / field_size)
1769 num_bytes = (entries*field_size+4)>>3;
1777 if (
avio_read(pb, buf, num_bytes) < num_bytes) {
1785 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1803 unsigned int i, entries;
1805 int64_t total_sample_count=0;
1816 av_dlog(c->
fc,
"track[%i].stts.entries = %i\n",
1819 if (entries >= UINT_MAX /
sizeof(*sc->
stts_data))
1826 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1827 int sample_duration;
1833 if (sample_duration < 0) {
1835 sample_duration = 1;
1840 av_dlog(c->
fc,
"sample_count=%d, sample_duration=%d\n",
1841 sample_count, sample_duration);
1843 duration+=(int64_t)sample_duration*sample_count;
1844 total_sample_count+=sample_count;
1870 unsigned int i, entries;
1885 if (entries >= UINT_MAX /
sizeof(*sc->
ctts_data))
1891 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1898 av_dlog(c->
fc,
"count=%d, duration=%d\n",
1901 if (
FFABS(duration) > (1<<28) && i+2<entries) {
1926 unsigned int i, entries;
1928 uint32_t grouping_type;
1938 if (grouping_type !=
MKTAG(
'r',
'a',
'p',
' '))
1946 if (entries >= UINT_MAX /
sizeof(*sc->
rap_group))
1952 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1965 int64_t current_offset;
1966 int64_t current_dts = 0;
1967 unsigned int stts_index = 0;
1968 unsigned int stsc_index = 0;
1969 unsigned int stss_index = 0;
1970 unsigned int stps_index = 0;
1972 uint64_t stream_size = 0;
1993 unsigned int current_sample = 0;
1994 unsigned int stts_sample = 0;
1995 unsigned int sample_size;
1997 unsigned int rap_group_index = 0;
1998 unsigned int rap_group_sample = 0;
2047 if (rap_group_present && rap_group_index < sc->rap_group_count) {
2050 if (++rap_group_sample == sc->
rap_group[rap_group_index].
count) {
2051 rap_group_sample = 0;
2061 e->
pos = current_offset;
2063 e->
size = sample_size;
2066 av_dlog(mov->
fc,
"AVIndex stream %d, sample %d, offset %"PRIx64
", dts %"PRId64
", "
2067 "size %d, distance %d, keyframe %d\n", st->
index, current_sample,
2068 current_offset, current_dts, sample_size, distance, keyframe);
2071 current_offset += sample_size;
2072 stream_size += sample_size;
2086 unsigned chunk_samples, total = 0;
2090 unsigned count, chunk_count;
2103 count = (chunk_samples+samples-1) / samples;
2105 count = (chunk_samples+1023) / 1024;
2108 if (i < sc->stsc_count - 1)
2112 total += chunk_count *
count;
2115 av_dlog(mov->
fc,
"chunk count %d\n", total);
2132 while (chunk_samples > 0) {
2134 unsigned size, samples;
2145 samples =
FFMIN(1024, chunk_samples);
2155 e->
pos = current_offset;
2160 av_dlog(mov->
fc,
"AVIndex stream %d, chunk %d, offset %"PRIx64
", dts %"PRId64
", "
2161 "size %d, duration %d\n", st->
index, i, current_offset, current_dts,
2164 current_offset +=
size;
2165 current_dts += samples;
2166 chunk_samples -= samples;
2178 char filename[1024];
2179 const char *src_path;
2183 src_path = strrchr(src,
'/');
2190 for (i = 0, l = strlen(ref->
path) - 1; l >= 0; l--)
2191 if (ref->
path[l] ==
'/') {
2199 if (i == ref->
nlvl_to - 1 && src_path - src <
sizeof(filename)) {
2200 memcpy(filename, src, src_path - src);
2201 filename[src_path -
src] = 0;
2211 }
else if (use_absolute_path) {
2213 "this is a possible security issue\n");
2238 if (!st)
return AVERROR(ENOMEM);
2241 if (!sc)
return AVERROR(ENOMEM);
2269 "stream %d, error opening alias: path='%s', dir='%s', "
2270 "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n",
2289 #if FF_API_R_FRAME_RATE
2303 #if CONFIG_H261_DECODER
2306 #if CONFIG_H263_DECODER
2309 #if CONFIG_MPEG4_DECODER
2340 while (atom.
size > 8) {
2343 if (tag ==
MKTAG(
'h',
'd',
'l',
'r')) {
2357 int64_t disp_transform[2];
2358 int display_matrix[3][2];
2400 for (i = 0; i < 3; i++) {
2408 sc->
width = width >> 16;
2409 sc->
height = height >> 16;
2414 if (display_matrix[1][0] == -65536 && display_matrix[0][1] == 65536) {
2418 if (display_matrix[0][0] == -65536 && display_matrix[1][1] == -65536) {
2422 if (display_matrix[1][0] == 65536 && display_matrix[0][1] == -65536) {
2430 if (width && height &&
2431 ((display_matrix[0][0] != 65536 ||
2432 display_matrix[1][1] != 65536) &&
2433 !display_matrix[0][1] &&
2434 !display_matrix[1][0] &&
2435 !display_matrix[2][0] && !display_matrix[2][1])) {
2436 for (i = 0; i < 2; i++)
2438 (int64_t) width * display_matrix[0][i] +
2439 (int64_t) height * display_matrix[1][i] +
2440 ((int64_t) display_matrix[2][i] << 16);
2444 ((
double) disp_transform[0] * height) /
2445 ((
double) disp_transform[1] * width), INT_MAX);
2454 int flags, track_id, i;
2525 int data_offset = 0;
2526 unsigned entries, first_sample_flags = frag->
flags;
2545 av_dlog(c->
fc,
"flags 0x%x entries %d\n", flags, entries);
2576 av_dlog(c->
fc,
"first sample flags 0x%x\n", first_sample_flags);
2577 for (i = 0; i < entries && !pb->
eof_reached; i++) {
2578 unsigned sample_size = frag->
size;
2579 int sample_flags = i ? frag->
flags : first_sample_flags;
2580 unsigned sample_duration = frag->
duration;
2593 else if (!found_keyframe)
2594 keyframe = found_keyframe =
2601 av_dlog(c->
fc,
"AVIndex stream %d, sample %d, offset %"PRIx64
", dts %"PRId64
", "
2603 offset, dts, sample_size, distance, keyframe);
2605 dts += sample_duration;
2606 offset += sample_size;
2633 if (atom.
type !=
MKTAG(
'm',
'd',
'a',
't')) {
2647 long cmov_len, moov_len;
2661 cmov_len = atom.
size - 6 * 4;
2672 if (uncompress (moov_data, (uLongf *) &moov_len, (
const Bytef *)cmov_data, cmov_len) != Z_OK)
2673 goto free_and_return;
2674 if (
ffio_init_context(&ctx, moov_data, moov_len, 0, NULL, NULL, NULL, NULL) != 0)
2675 goto free_and_return;
2677 atom.
size = moov_len;
2693 int i, edit_count,
version, edit_start_index = 0;
2704 if ((uint64_t)edit_count*12+8 > atom.
size)
2708 for (i=0; i<edit_count; i++){
2720 if (i == 0 && time == -1) {
2722 edit_start_index = 1;
2723 }
else if (i == edit_start_index && time >= 0)
2728 av_dlog(c->
fc,
"duration=%"PRId64
" time=%"PRId64
" rate=%f\n",
2729 duration, time, rate / 65536.0);
2734 "a/v desync might occur, patch welcome\n");
2754 static const uint8_t uuid_isml_manifest[] = {
2755 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
2756 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66
2759 if (atom.
size <
sizeof(uuid) || atom.
size == INT64_MAX)
2762 ret =
avio_read(pb, uuid,
sizeof(uuid));
2765 }
else if (ret !=
sizeof(uuid)) {
2768 if (!memcmp(uuid, uuid_isml_manifest,
sizeof(uuid))) {
2771 size_t len = atom.
size -
sizeof(uuid);
2787 }
else if (ret != len) {
2793 while ((ptr =
av_stristr(ptr,
"systemBitrate=\"")) != NULL) {
2794 ptr +=
sizeof(
"systemBitrate=\"") - 1;
2803 ret = strtol(ptr, &endptr, 10);
2804 if (ret < 0 || errno || *endptr !=
'"') {
2885 int64_t total_size = 0;
2890 atom.
size = INT64_MAX;
2895 if (atom.
size >= 8) {
2898 if (atom.
type !=
MKTAG(
'r',
'o',
'o',
't') &&
2914 av_dlog(c->
fc,
"type: %08x '%.4s' parent:'%.4s' sz: %"PRId64
" %"PRId64
" %"PRId64
"\n",
2917 a.
size = atom.
size - total_size + 8;
2924 for (i = 0; mov_default_parse_table[i].
type; i++)
2925 if (mov_default_parse_table[i].
type == a.
type) {
2940 int err =
parse(c, pb, a);
2959 total_size += a.
size;
2962 if (total_size < atom.
size && atom.
size < 0x7ffff)
2973 int moov_offset = -1;
2979 if ((offset + 8) > (
unsigned int)p->
buf_size)
2984 case MKTAG(
'm',
'o',
'o',
'v'):
2985 moov_offset = offset + 4;
2986 case MKTAG(
'j',
'P',
' ',
' '):
2987 case MKTAG(
'm',
'd',
'a',
't'):
2988 case MKTAG(
'p',
'n',
'o',
't'):
2989 case MKTAG(
'u',
'd',
't',
'a'):
2990 case MKTAG(
'f',
't',
'y',
'p'):
2993 offset + 12 > (
unsigned int)p->
buf_size ||
3002 case MKTAG(
'e',
'd',
'i',
'w'):
3003 case MKTAG(
'w',
'i',
'd',
'e'):
3004 case MKTAG(
'f',
'r',
'e',
'e'):
3005 case MKTAG(
'j',
'u',
'n',
'k'):
3006 case MKTAG(
'p',
'i',
'c',
't'):
3010 case MKTAG(0x82,0x82,0x7f,0x7d):
3011 case MKTAG(
's',
'k',
'i',
'p'):
3012 case MKTAG(
'u',
'u',
'i',
'd'):
3013 case MKTAG(
'p',
'r',
'f',
'l'):
3025 offset = moov_offset;
3027 while(offset < (p->
buf_size - 16)){
3032 av_log(NULL,
AV_LOG_WARNING,
"Found media data tag MPEG indicating this is a MOV-packed MPEG-PS.\n");
3084 if (len > sample->
size-2)
3086 title_len = 2*len + 1;
3099 else if (ch == 0xfffe)
3103 if (len == 1 || len == 2)
3247 atom.
size = INT64_MAX;
3276 int tmcd_st_id = -1;
3282 if (tmcd_st_id < 0 || tmcd_st_id == i)
3321 int64_t best_dts = INT64_MAX;
3332 ((msc->
pb != s->
pb && dts < best_dts) || (msc->
pb == s->
pb &&
3335 sample = current_sample;
3395 #if CONFIG_DV_DEMUXER
3430 av_dlog(s,
"stream %d, pts %"PRId64
", dts %"PRId64
", pos 0x%"PRIx64
", duration %d\n",
3442 av_dlog(s,
"stream %d, timestamp %"PRId64
", sample %d\n", st->
index, timestamp, sample);
3443 if (sample < 0 && st->nb_index_entries && timestamp < st->index_entries[0].timestamp)
3468 int64_t seek_timestamp, timestamp;
3475 st = s->
streams[stream_index];
3488 if (stream_index == i)
3498 {
"use_absolute_path",
3499 "allow using absolute path when opening alias, this is a possible security issue",
3515 .
name =
"mov,mp4,m4a,3gp,3g2,mj2",
3523 .priv_class = &mov_class,