28 #include "libavutil/attributes.h"
29 #include "libavutil/channel_layout.h"
30 #include "libavutil/intreadwrite.h"
31 #include "libavutil/intfloat.h"
32 #include "libavutil/mathematics.h"
33 #include "libavutil/avstring.h"
34 #include "libavutil/dict.h"
35 #include "libavutil/opt.h"
36 #include "libavutil/timecode.h"
72 unsigned len,
const char *key)
76 short current, total = 0;
82 snprintf(buf,
sizeof(buf),
"%d", current);
84 snprintf(buf,
sizeof(buf),
"%d/%d", current, total);
91 unsigned len,
const char *key)
107 unsigned len,
const char *key)
118 unsigned len,
const char *key)
136 char key[1024]={0},
data[1024]={0};
146 if (atom.
size <= 8)
return 0;
148 for (i = 0; i < 3; i++) {
151 int str_size = 0, skip_size = 0;
155 case MKTAG(
'n',
'a',
'm',
'e'):
157 str_size = skip_size = data_size - 12;
161 case MKTAG(
'd',
'a',
't',
'a'):
164 str_size = skip_size = data_size - 16;
169 skip_size = data_size - 8;
177 target[str_size] = 0;
179 atom.
size -= skip_size;
182 if (skip_size > str_size)
avio_skip(pb, skip_size - str_size);
186 if (strcmp(key,
"iTunSMPB") == 0) {
187 int priming, remainder,
samples;
188 if(sscanf(
data,
"%*X %X %X %X", &priming, &remainder, &samples) == 3){
189 if(priming>0 && priming<16384)
194 if (strcmp(key,
"cdec") == 0) {
203 0x00C4,0x00C5,0x00C7,0x00C9,0x00D1,0x00D6,0x00DC,0x00E1,
204 0x00E0,0x00E2,0x00E4,0x00E3,0x00E5,0x00E7,0x00E9,0x00E8,
205 0x00EA,0x00EB,0x00ED,0x00EC,0x00EE,0x00EF,0x00F1,0x00F3,
206 0x00F2,0x00F4,0x00F6,0x00F5,0x00FA,0x00F9,0x00FB,0x00FC,
207 0x2020,0x00B0,0x00A2,0x00A3,0x00A7,0x2022,0x00B6,0x00DF,
208 0x00AE,0x00A9,0x2122,0x00B4,0x00A8,0x2260,0x00C6,0x00D8,
209 0x221E,0x00B1,0x2264,0x2265,0x00A5,0x00B5,0x2202,0x2211,
210 0x220F,0x03C0,0x222B,0x00AA,0x00BA,0x03A9,0x00E6,0x00F8,
211 0x00BF,0x00A1,0x00AC,0x221A,0x0192,0x2248,0x2206,0x00AB,
212 0x00BB,0x2026,0x00A0,0x00C0,0x00C3,0x00D5,0x0152,0x0153,
213 0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA,
214 0x00FF,0x0178,0x2044,0x20AC,0x2039,0x203A,0xFB01,0xFB02,
215 0x2021,0x00B7,0x201A,0x201E,0x2030,0x00C2,0x00CA,0x00C1,
216 0x00CB,0x00C8,0x00CD,0x00CE,0x00CF,0x00CC,0x00D3,0x00D4,
217 0xF8FF,0x00D2,0x00DA,0x00DB,0x00D9,0x0131,0x02C6,0x02DC,
218 0x00AF,0x02D8,0x02D9,0x02DA,0x00B8,0x02DD,0x02DB,0x02C7,
222 char *
dst,
int dstlen)
225 char *
end = dst+dstlen-1;
228 for (i = 0; i <
len; i++) {
230 if (c < 0x80 && p < end)
282 unsigned len,
const char *key)
298 #ifdef MOV_EXPORT_ALL_METADATA
301 char str[1024], key2[16], language[4] = {0};
302 const char *key =
NULL;
303 uint16_t langcode = 0;
304 uint32_t data_type = 0, str_size;
311 case MKTAG(0xa9,
'n',
'a',
'm'): key =
"title";
break;
312 case MKTAG(0xa9,
'a',
'u',
't'):
313 case MKTAG(0xa9,
'A',
'R',
'T'): key =
"artist";
break;
314 case MKTAG(
'a',
'A',
'R',
'T'): key =
"album_artist";
break;
315 case MKTAG(0xa9,
'w',
'r',
't'): key =
"composer";
break;
316 case MKTAG(
'c',
'p',
'r',
't'):
317 case MKTAG(0xa9,
'c',
'p',
'y'): key =
"copyright";
break;
318 case MKTAG(0xa9,
'g',
'r',
'p'): key =
"grouping";
break;
319 case MKTAG(0xa9,
'l',
'y',
'r'): key =
"lyrics";
break;
320 case MKTAG(0xa9,
'c',
'm',
't'):
321 case MKTAG(0xa9,
'i',
'n',
'f'): key =
"comment";
break;
322 case MKTAG(0xa9,
'a',
'l',
'b'): key =
"album";
break;
323 case MKTAG(0xa9,
'd',
'a',
'y'): key =
"date";
break;
324 case MKTAG(0xa9,
'g',
'e',
'n'): key =
"genre";
break;
325 case MKTAG(
'g',
'n',
'r',
'e'): key =
"genre";
327 case MKTAG(0xa9,
't',
'o',
'o'):
328 case MKTAG(0xa9,
's',
'w',
'r'): key =
"encoder";
break;
329 case MKTAG(0xa9,
'e',
'n',
'c'): key =
"encoder";
break;
330 case MKTAG(0xa9,
'm',
'a',
'k'): key =
"make";
break;
331 case MKTAG(0xa9,
'm',
'o',
'd'): key =
"model";
break;
332 case MKTAG(0xa9,
'x',
'y',
'z'): key =
"location";
break;
333 case MKTAG(
'd',
'e',
's',
'c'): key =
"description";
break;
334 case MKTAG(
'l',
'd',
'e',
's'): key =
"synopsis";
break;
335 case MKTAG(
't',
'v',
's',
'h'): key =
"show";
break;
336 case MKTAG(
't',
'v',
'e',
'n'): key =
"episode_id";
break;
337 case MKTAG(
't',
'v',
'n',
'n'): key =
"network";
break;
338 case MKTAG(
't',
'r',
'k',
'n'): key =
"track";
340 case MKTAG(
'd',
'i',
's',
'k'): key =
"disc";
342 case MKTAG(
't',
'v',
'e',
's'): key =
"episode_sort";
344 case MKTAG(
't',
'v',
's',
'n'): key =
"season_number";
346 case MKTAG(
's',
't',
'i',
'k'): key =
"media_type";
348 case MKTAG(
'h',
'd',
'v',
'd'): key =
"hd_video";
350 case MKTAG(
'p',
'g',
'a',
'p'): key =
"gapless_playback";
352 case MKTAG(
'@',
'P',
'R',
'M'):
354 case MKTAG(
'@',
'P',
'R',
'Q'):
361 if (tag ==
MKTAG(
'd',
'a',
't',
'a')) {
364 str_size = data_size - 16;
367 if (atom.
type ==
MKTAG(
'c',
'o',
'v',
'r')) {
381 str_size = atom.
size;
383 #ifdef MOV_EXPORT_ALL_METADATA
392 if (atom.
size < 0 || str_size >= INT_MAX/2)
395 str_size =
FFMIN3(
sizeof(str)-1, str_size, atom.
size);
398 parse(c, pb, str_size, key);
400 if (data_type == 3 || (data_type == 0 && (langcode < 0x400 || langcode == 0x7fff))) {
407 if (*language && strcmp(language,
"und")) {
408 snprintf(key2,
sizeof(key2),
"%s-%s", key, language);
412 av_dlog(c->
fc,
"lang \"%3s\" ", language);
413 av_dlog(c->
fc,
"tag \"%s\" value \"%s\" atom \"%.4s\" %d %"PRId64
"\n",
414 key, str, (
char*)&atom.
type, str_size, atom.
size);
422 int i, nb_chapters, str_len,
version;
425 if ((atom.
size -= 5) < 0)
434 for (i = 0; i < nb_chapters; i++) {
441 if ((atom.
size -= 9+str_len) < 0)
451 #define MIN_DATA_ENTRY_BOX_SIZE 12
466 entries >= UINT_MAX /
sizeof(*sc->
drefs))
485 av_dlog(c->
fc,
"type %.4s size %d\n", (
char*)&dref->
type, size);
487 if (dref->
type ==
MKTAG(
'a',
'l',
'i',
's') && size > 150) {
489 uint16_t volume_len,
len;
495 volume_len =
FFMIN(volume_len, 27);
497 dref->
volume[volume_len] = 0;
503 len =
FFMIN(len, 63);
518 for (type = 0; type != -1 &&
avio_tell(pb) < next; ) {
532 if (len > volume_len && !strncmp(dref->
path, dref->
volume, volume_len)) {
534 memmove(dref->
path, dref->
path+volume_len, len);
537 for (j = 0; j <
len; j++)
538 if (dref->
path[j] ==
':')
541 }
else if (type == 0) {
548 for (j = 0; j <
len; j++)
549 if (dref->
dir[j] ==
':')
581 av_dlog(c->
fc,
"ctype= %.4s (0x%08x)\n", (
char*)&ctype, ctype);
582 av_dlog(c->
fc,
"stype= %.4s\n", (
char*)&type);
584 if (type ==
MKTAG(
'v',
'i',
'd',
'e'))
586 else if (type ==
MKTAG(
's',
'o',
'u',
'n'))
588 else if (type ==
MKTAG(
'm',
'1',
'a',
' '))
590 else if ((type ==
MKTAG(
's',
'u',
'b',
'p')) || (type ==
MKTAG(
'c',
'l',
'c',
'p')))
597 title_size = atom.
size - 24;
598 if (title_size > 0) {
603 title_str[title_size] = 0;
606 (!c->
isom && title_str[0] == title_size - 1), 0);
643 int ac3info, acmod, lfeon, bsmod;
650 bsmod = (ac3info >> 14) & 0x7;
651 acmod = (ac3info >> 11) & 0x7;
652 lfeon = (ac3info >> 10) & 0x1;
653 st->
codec->
channels = ((
int[]){2,1,2,3,3,4,4,5})[acmod] + lfeon;
667 int eac3info, acmod, lfeon, bsmod;
678 bsmod = (eac3info >> 12) & 0x1f;
679 acmod = (eac3info >> 9) & 0x7;
680 lfeon = (eac3info >> 8) & 0x1;
739 "sample aspect ratio already set to %d:%d, ignoring 'pasp' atom (%d:%d)\n",
742 }
else if (den != 0) {
763 char minor_ver_str[11];
764 char* comp_brands_str;
768 if (strcmp(type,
"qt "))
773 snprintf(minor_ver_str,
sizeof(minor_ver_str),
"%d", minor_ver);
776 comp_brand_size = atom.
size - 8;
777 if (comp_brand_size < 0)
779 comp_brands_str =
av_malloc(comp_brand_size + 1);
780 if (!comp_brands_str)
782 avio_read(pb, comp_brands_str, comp_brand_size);
783 comp_brands_str[comp_brand_size] = 0;
816 if(time >= 2082844800)
819 ptm = gmtime(&timet);
821 strftime(buffer,
sizeof(buffer),
"%Y-%m-%d %H:%M:%S", ptm);
831 char language[4] = {0};
833 int64_t creation_time;
868 int64_t creation_time;
917 av_dlog(c->
fc,
"enda %d\n", little_endian);
918 if (little_endian == 1) {
942 unsigned mov_field_order;
951 if ((mov_field_order & 0xFF00) == 0x0100)
953 else if ((mov_field_order & 0xFF00) == 0x0200) {
954 switch (mov_field_order & 0xFF) {
989 if (size > INT_MAX || (uint64_t)atom.
size > INT_MAX)
1037 if ((uint64_t)atom.
size > (1<<30))
1049 }
else if (atom.
size > 8) {
1070 if ((uint64_t)atom.
size > (1<<30))
1073 if (atom.
size >= 10) {
1079 if (type ==
MKTAG(
'f',
'i',
'e',
'l') && size == atom.
size)
1101 if (atom.
size >= (1<<28) || atom.
size < 7)
1105 if ((profile_level & 0xf0) != 0xc0)
1130 if (atom.
size <= 40)
1134 if ((uint64_t)atom.
size > (1<<30))
1152 unsigned int i, entries;
1166 if (entries >= UINT_MAX/
sizeof(int64_t))
1178 if (atom.
type ==
MKTAG(
's',
't',
'c',
'o'))
1181 else if (atom.
type ==
MKTAG(
'c',
'o',
'6',
'4'))
1213 int j, pseudo_stream_id;
1220 for (pseudo_stream_id = 0;
1222 pseudo_stream_id++) {
1235 }
else if (size <= 7){
1260 if (
id<=0 && ((format&0xFFFF) ==
'm'+(
's'<<8) || (format&0xFFFF) ==
'T'+(
'S'<<8)))
1266 format && format !=
MKTAG(
'm',
'p',
'4',
's')) {
1281 av_dlog(c->
fc,
"size=%"PRId64
" 4CC= %c%c%c%c codec_type=%d\n", size,
1282 (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff,
1286 unsigned int color_depth,
len;
1287 int color_greyscale;
1318 if (format ==
MKTAG(
'H',
'2',
'6',
'3') &&
1324 av_dlog(c->
fc,
"depth %d, ctab id %d\n",
1331 if ((color_depth == 2) || (color_depth == 4) ||
1332 (color_depth == 8)) {
1334 unsigned int color_start, color_count, color_end;
1335 unsigned char a,
r,
g,
b;
1337 if (color_greyscale) {
1338 int color_index, color_dec;
1341 color_count = 1 << color_depth;
1343 color_dec = 256 / (color_count - 1);
1344 for (j = 0; j < color_count; j++) {
1346 r = g = b = color_count - 1 - color_index;
1348 r = g = b = color_index;
1350 (0xFF
U << 24) | (r << 16) | (g << 8) | (b);
1351 color_index -= color_dec;
1352 if (color_index < 0)
1355 }
else if (color_table_id) {
1358 color_count = 1 << color_depth;
1359 if (color_depth == 2)
1361 else if (color_depth == 4)
1366 for (j = 0; j < color_count; j++) {
1367 r = color_table[j * 3 + 0];
1368 g = color_table[j * 3 + 1];
1369 b = color_table[j * 3 + 2];
1371 (0xFF
U << 24) | (r << 16) | (g << 8) | (b);
1378 if ((color_start <= 255) &&
1379 (color_end <= 255)) {
1380 for (j = color_start; j <= color_end; j++) {
1392 (a << 24 ) | (r << 16) | (g << 8) | (b);
1399 int bits_per_sample,
flags;
1419 (compatible_brands && strstr(compatible_brands->
value,
"qt "))) {
1425 }
else if (version==2) {
1434 if (format ==
MKTAG(
'l',
'p',
'c',
'm'))
1476 if (bits_per_sample) {
1484 if (format !=
AV_RL32(
"mp4s"))
1512 }
else if (a.
size > 0)
1524 #if CONFIG_DV_DEMUXER
1600 unsigned int i, entries;
1616 if (entries >= UINT_MAX /
sizeof(*sc->
stsc_data))
1626 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1644 unsigned i, entries;
1654 if (entries >= UINT_MAX /
sizeof(*sc->
stps_data))
1660 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1677 unsigned int i, entries;
1689 av_dlog(c->
fc,
"keyframe_count = %d\n", entries);
1698 if (entries >= UINT_MAX /
sizeof(
int))
1704 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1721 unsigned int i, entries, sample_size, field_size, num_bytes;
1733 if (atom.
type ==
MKTAG(
's',
't',
's',
'z')) {
1752 if (field_size != 4 && field_size != 8 && field_size != 16 && field_size != 32) {
1759 if (entries >= UINT_MAX /
sizeof(
int) || entries >= (UINT_MAX - 4) / field_size)
1765 num_bytes = (entries*field_size+4)>>3;
1773 if (
avio_read(pb, buf, num_bytes) < num_bytes) {
1781 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1799 unsigned int i, entries;
1801 int64_t total_sample_count=0;
1812 av_dlog(c->
fc,
"track[%i].stts.entries = %i\n",
1815 if (entries >= UINT_MAX /
sizeof(*sc->
stts_data))
1822 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1823 int sample_duration;
1829 if (sample_duration < 0) {
1831 sample_duration = 1;
1836 av_dlog(c->
fc,
"sample_count=%d, sample_duration=%d\n",
1837 sample_count, sample_duration);
1839 duration+=(int64_t)sample_duration*sample_count;
1840 total_sample_count+=sample_count;
1859 unsigned int i, entries;
1874 if (entries >= UINT_MAX /
sizeof(*sc->
ctts_data))
1880 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1887 av_dlog(c->
fc,
"count=%d, duration=%d\n",
1890 if (
FFABS(duration) > (1<<28) && i+2<entries) {
1897 if (duration < 0 && i+2<entries)
1915 unsigned int i, entries;
1917 uint32_t grouping_type;
1927 if (grouping_type !=
MKTAG(
'r',
'a',
'p',
' '))
1935 if (entries >= UINT_MAX /
sizeof(*sc->
rap_group))
1941 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1954 int64_t current_offset;
1955 int64_t current_dts = 0;
1956 unsigned int stts_index = 0;
1957 unsigned int stsc_index = 0;
1958 unsigned int stss_index = 0;
1959 unsigned int stps_index = 0;
1961 uint64_t stream_size = 0;
1982 unsigned int current_sample = 0;
1983 unsigned int stts_sample = 0;
1984 unsigned int sample_size;
1986 unsigned int rap_group_index = 0;
1987 unsigned int rap_group_sample = 0;
2024 if (rap_group_present && rap_group_index < sc->rap_group_count) {
2027 if (++rap_group_sample == sc->
rap_group[rap_group_index].
count) {
2028 rap_group_sample = 0;
2034 && !rap_group_present
2043 e->
pos = current_offset;
2045 e->
size = sample_size;
2048 av_dlog(mov->
fc,
"AVIndex stream %d, sample %d, offset %"PRIx64
", dts %"PRId64
", "
2049 "size %d, distance %d, keyframe %d\n", st->
index, current_sample,
2050 current_offset, current_dts, sample_size, distance, keyframe);
2053 current_offset += sample_size;
2054 stream_size += sample_size;
2068 unsigned chunk_samples, total = 0;
2072 unsigned count, chunk_count;
2085 count = (chunk_samples+samples-1) /
samples;
2087 count = (chunk_samples+1023) / 1024;
2090 if (i < sc->stsc_count - 1)
2094 total += chunk_count * count;
2097 av_dlog(mov->
fc,
"chunk count %d\n", total);
2114 while (chunk_samples > 0) {
2127 samples =
FFMIN(1024, chunk_samples);
2137 e->
pos = current_offset;
2142 av_dlog(mov->
fc,
"AVIndex stream %d, chunk %d, offset %"PRIx64
", dts %"PRId64
", "
2143 "size %d, duration %d\n", st->
index, i, current_offset, current_dts,
2146 current_offset +=
size;
2160 char filename[1024];
2161 const char *src_path;
2165 src_path = strrchr(src,
'/');
2172 for (i = 0, l = strlen(ref->
path) - 1; l >= 0; l--)
2173 if (ref->
path[l] ==
'/') {
2181 if (i == ref->
nlvl_to - 1 && src_path - src <
sizeof(filename)) {
2182 memcpy(filename, src, src_path - src);
2183 filename[src_path - src] = 0;
2193 }
else if (use_absolute_path) {
2195 "this is a possible security issue\n");
2220 if (!st)
return AVERROR(ENOMEM);
2223 if (!sc)
return AVERROR(ENOMEM);
2251 "stream %d, error opening alias: path='%s', dir='%s', "
2252 "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n",
2271 #if FF_API_R_FRAME_RATE
2273 av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den,
2285 #if CONFIG_H261_DECODER
2288 #if CONFIG_H263_DECODER
2291 #if CONFIG_MPEG4_DECODER
2322 while (atom.
size > 8) {
2325 if (tag ==
MKTAG(
'h',
'd',
'l',
'r')) {
2339 int64_t disp_transform[2];
2340 int display_matrix[3][2];
2382 for (i = 0; i < 3; i++) {
2390 sc->
width = width >> 16;
2391 sc->
height = height >> 16;
2396 if (display_matrix[1][0] == -65536 && display_matrix[0][1] == 65536) {
2400 if (display_matrix[0][0] == -65536 && display_matrix[1][1] == -65536) {
2404 if (display_matrix[1][0] == 65536 && display_matrix[0][1] == -65536) {
2412 if (width && height &&
2413 ((display_matrix[0][0] != 65536 ||
2414 display_matrix[1][1] != 65536) &&
2415 !display_matrix[0][1] &&
2416 !display_matrix[1][0] &&
2417 !display_matrix[2][0] && !display_matrix[2][1])) {
2418 for (i = 0; i < 2; i++)
2420 (int64_t) width * display_matrix[0][i] +
2421 (int64_t) height * display_matrix[1][i] +
2422 ((int64_t) display_matrix[2][i] << 16);
2426 ((
double) disp_transform[0] * height) /
2427 ((
double) disp_transform[1] * width), INT_MAX);
2436 int flags, track_id, i;
2507 int data_offset = 0;
2508 unsigned entries, first_sample_flags = frag->
flags;
2527 av_dlog(c->
fc,
"flags 0x%x entries %d\n", flags, entries);
2558 av_dlog(c->
fc,
"first sample flags 0x%x\n", first_sample_flags);
2559 for (i = 0; i < entries && !pb->
eof_reached; i++) {
2560 unsigned sample_size = frag->
size;
2561 int sample_flags = i ? frag->
flags : first_sample_flags;
2562 unsigned sample_duration = frag->
duration;
2574 else if (!found_keyframe)
2575 keyframe = found_keyframe =
2582 av_dlog(c->
fc,
"AVIndex stream %d, sample %d, offset %"PRIx64
", dts %"PRId64
", "
2584 offset, dts, sample_size, distance, keyframe);
2586 dts += sample_duration;
2587 offset += sample_size;
2614 if (atom.
type !=
MKTAG(
'm',
'd',
'a',
't')) {
2628 long cmov_len, moov_len;
2642 cmov_len = atom.
size - 6 * 4;
2653 if (uncompress (moov_data, (uLongf *) &moov_len, (
const Bytef *)cmov_data, cmov_len) != Z_OK)
2654 goto free_and_return;
2656 goto free_and_return;
2658 atom.
size = moov_len;
2674 int i, edit_count,
version, edit_start_index = 0;
2685 if ((uint64_t)edit_count*12+8 > atom.
size)
2689 for (i=0; i<edit_count; i++){
2701 if (i == 0 && time == -1) {
2703 edit_start_index = 1;
2704 }
else if (i == edit_start_index && time >= 0)
2709 av_dlog(c->
fc,
"duration=%"PRId64
" time=%"PRId64
" rate=%f\n",
2710 duration, time, rate / 65536.0);
2715 "a/v desync might occur, patch welcome\n");
2799 int64_t total_size = 0;
2810 atom.
size = INT64_MAX;
2815 if (atom.
size >= 8) {
2818 if (atom.
type !=
MKTAG(
'r',
'o',
'o',
't') &&
2830 if (a.
size == 1 && total_size + 8 <= atom.
size) {
2835 av_dlog(c->
fc,
"type: %08x '%.4s' parent:'%.4s' sz: %"PRId64
" %"PRId64
" %"PRId64
"\n",
2838 a.
size = atom.
size - total_size + 8;
2845 for (i = 0; mov_default_parse_table[i].
type; i++)
2846 if (mov_default_parse_table[i].type == a.
type) {
2861 int err =
parse(c, pb, a);
2883 total_size += a.
size;
2886 if (total_size < atom.
size && atom.
size < 0x7ffff)
2898 int moov_offset = -1;
2904 if ((offset + 8) > (
unsigned int)p->
buf_size)
2909 case MKTAG(
'm',
'o',
'o',
'v'):
2910 moov_offset = offset + 4;
2911 case MKTAG(
'j',
'P',
' ',
' '):
2912 case MKTAG(
'm',
'd',
'a',
't'):
2913 case MKTAG(
'p',
'n',
'o',
't'):
2914 case MKTAG(
'u',
'd',
't',
'a'):
2915 case MKTAG(
'f',
't',
'y',
'p'):
2918 offset + 12 > (
unsigned int)p->
buf_size ||
2927 case MKTAG(
'e',
'd',
'i',
'w'):
2928 case MKTAG(
'w',
'i',
'd',
'e'):
2929 case MKTAG(
'f',
'r',
'e',
'e'):
2930 case MKTAG(
'j',
'u',
'n',
'k'):
2931 case MKTAG(
'p',
'i',
'c',
't'):
2935 case MKTAG(0x82,0x82,0x7f,0x7d):
2936 case MKTAG(
's',
'k',
'i',
'p'):
2937 case MKTAG(
'u',
'u',
'i',
'd'):
2938 case MKTAG(
'p',
'r',
'f',
'l'):
2950 offset = moov_offset;
2952 while(offset < (p->
buf_size - 16)){
3009 if (len > sample->
size-2)
3011 title_len = 2*len + 1;
3024 else if (ch == 0xfffe)
3028 if (len == 1 || len == 2)
3171 atom.
size = INT64_MAX;
3200 int tmcd_st_id = -1;
3206 if (tmcd_st_id < 0 || tmcd_st_id == i)
3239 int64_t best_dts = INT64_MAX;
3250 ((msc->
pb != s->
pb && dts < best_dts) || (msc->
pb == s->
pb &&
3253 sample = current_sample;
3308 #if CONFIG_DV_DEMUXER
3343 av_dlog(s,
"stream %d, pts %"PRId64
", dts %"PRId64
", pos 0x%"PRIx64
", duration %d\n",
3355 av_dlog(s,
"stream %d, timestamp %"PRId64
", sample %d\n", st->
index, timestamp, sample);
3356 if (sample < 0 && st->nb_index_entries && timestamp < st->index_entries[0].timestamp)
3381 int64_t seek_timestamp, timestamp;
3388 st = s->
streams[stream_index];
3401 if (stream_index == i)
3411 {
"use_absolute_path",
3412 "allow using absolute path when opening alias, this is a possible security issue",
3420 static const AVClass class = {
3428 .
name =
"mov,mp4,m4a,3gp,3g2,mj2",
3436 .priv_class = &
class,