43 int field = timecode & 0xff;
44 int frame = fields_per_frame ? field / fields_per_frame : field;
45 int second = (timecode >> 8) & 0xff;
46 int minute = (timecode >> 16) & 0xff;
47 int hour = (timecode >> 24) & 0x1f;
48 int drop = (timecode >> 29) & 1;
53 snprintf(tmp,
sizeof(tmp),
"%02d:%02d:%02d%c%02d",
54 hour, minute, second, drop ?
';' :
':', frame);
72 if ((*length >> 24) || *length < 16)
88 static const uint8_t startcode[] = {0, 0, 0, 0, 1, 0xbc};
89 static const uint8_t endcode[] = {0, 0, 0, 0, 0xe1, 0xe2};
90 if (!memcmp(p->
buf, startcode,
sizeof(startcode)) &&
91 !memcmp(&p->
buf[16 -
sizeof(endcode)], endcode,
sizeof(endcode)))
227 if (fps < 1 || fps > 9) fps = 9;
228 return frame_rate_tab[fps - 1];
237 static const AVRational map[] = {{50, 1}, {60000, 1001}, {24, 1},
238 {25, 1}, {30000, 1001}};
239 int idx =
av_log2((flags & 0x7c0) >> 6);
263 else if (tag ==
TRACK_FPF && (value == 1 || value == 2))
265 }
else if (tlen == 8 && tag ==
TRACK_AUX)
287 if (map_cnt > 1000) {
291 if (pkt_len < 4 * map_cnt) {
296 pkt_len -= 4 * map_cnt;
298 for (i = 0; i < map_cnt; i++)
300 i * (uint64_t)fields_per_map + 1, 0, 0, 0);
338 int track_type, track_id, track_len;
346 if (!(track_type & 0x80)) {
351 if ((track_id & 0xc0) != 0xc0) {
358 if (track_type == 7 || track_type == 8 || track_type == 24) {
367 if (idx < 0)
continue;
369 if (!main_timebase.
num || !main_timebase.
den) {
399 if (!main_timebase.
num || !main_timebase.
den) {
401 " This might give wrong results.\n");
403 main_timebase.
num = fps.
den;
404 main_timebase.
den = fps.
num * 2;
422 if (!main_timebase.
num || !main_timebase.
den)
433 if (!max_interval-- || url_feof(pb)) \
435 tmp = tmp << 8 | avio_r8(pb); \
448 uint64_t last_found_pos = 0;
465 if (
avio_seek(pb, last_pos, SEEK_SET) < 0)
473 if ((track >= 0 && track != cur_track) || (timestamp >= 0 && timestamp > cur_timestamp)) {
474 if (
avio_seek(pb, last_pos, SEEK_SET) >= 0)
480 return cur_timestamp;
491 int track_type, track_id, ret;
492 int field_nr, field_info, skip = 0;
514 stream_index =
get_sindex(s, track_id, track_type);
515 if (stream_index < 0)
525 int first = field_info >> 16;
526 int last = field_info & 0xffff;
528 if (first <= last && last*bps <= pkt_len) {
530 skip = pkt_len - last*
bps;
531 pkt_len = (last-first)*bps;
553 uint64_t maxlen = 100 * 1024 * 1024;
558 if (timestamp < start_time) timestamp =
start_time;
564 if (idx < st->nb_index_entries - 2)
566 maxlen =
FFMAX(maxlen, 200 * 1024);
571 if (
FFABS(found - timestamp) > 4)
577 int64_t *pos, int64_t pos_limit) {