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)))
235 if (fps < 1 || fps > 9) fps = 9;
236 return frame_rate_tab[fps - 1];
245 static const AVRational map[] = {{50, 1}, {60000, 1001}, {24, 1},
246 {25, 1}, {30000, 1001}};
247 int idx =
av_log2((flags & 0x7c0) >> 6);
271 else if (tag ==
TRACK_FPF && (value == 1 || value == 2))
273 }
else if (tlen == 8 && tag ==
TRACK_AUX)
295 if (map_cnt > 1000) {
299 if (pkt_len < 4 * map_cnt) {
304 pkt_len -= 4 * map_cnt;
306 for (i = 0; i < map_cnt; i++)
308 i * (uint64_t)fields_per_map + 1, 0, 0, 0);
346 int track_type, track_id, track_len;
354 if (!(track_type & 0x80)) {
359 if ((track_id & 0xc0) != 0xc0) {
366 if (track_type == 7 || track_type == 8 || track_type == 24) {
375 if (idx < 0)
continue;
377 if (!main_timebase.
num || !main_timebase.
den) {
407 if (!main_timebase.
num || !main_timebase.
den) {
409 " This might give wrong results.\n");
411 main_timebase.
num = fps.
den;
412 main_timebase.
den = fps.
num * 2;
430 if (!main_timebase.
num || !main_timebase.
den)
441 if (!max_interval-- || url_feof(pb)) \
443 tmp = tmp << 8 | avio_r8(pb); \
456 uint64_t last_found_pos = 0;
473 if (
avio_seek(pb, last_pos, SEEK_SET) < 0)
481 if ((track >= 0 && track != cur_track) || (timestamp >= 0 && timestamp > cur_timestamp)) {
482 if (
avio_seek(pb, last_pos, SEEK_SET) >= 0)
488 return cur_timestamp;
499 int track_type, track_id,
ret;
500 int field_nr, field_info, skip = 0;
522 stream_index =
get_sindex(s, track_id, track_type);
523 if (stream_index < 0)
533 int first = field_info >> 16;
534 int last = field_info & 0xffff;
536 if (first <= last && last*bps <= pkt_len) {
538 skip = pkt_len - last*
bps;
539 pkt_len = (last-first)*bps;
561 uint64_t maxlen = 100 * 1024 * 1024;
566 if (timestamp < start_time) timestamp =
start_time;
572 if (idx < st->nb_index_entries - 2)
574 maxlen =
FFMAX(maxlen, 200 * 1024);
579 if (
FFABS(found - timestamp) > 4)
585 int64_t *pos, int64_t pos_limit) {