34 int64_t pos, avail_size;
56 if (size <= avail_size)
81 int len, fill_size, size1, frame_offset,
id;
153 av_dlog(s,
"seek to %"PRIx64
" -> %"PRIx64
"\n", pos1, pos);
165 av_dlog(s,
"dts=%0.6f\n", dts / 1000000.0);
175 int64_t pos_min, pos_max;
183 pts_start =
get_dts(s, pos_min);
187 if (pts - 100000 > pts_start)
192 pts_start =
get_dts(s, pos_min);
196 if (pts - 100000 <= pts_start) {
203 if (newpos == pos_min)
208 if (newpts - 100000 <= pts) {
256 ffm->
file_size = (UINT64_C(1) << 63) - 1;
269 case MKBETAG(
'M',
'A',
'I',
'N'):
273 case MKBETAG(
'C',
'O',
'M',
'M'):
299 case MKBETAG(
'S',
'T',
'V',
'I'):
312 avio_get_str(pb, INT_MAX, rc_eq_buf,
sizeof(rc_eq_buf));
345 case MKBETAG(
'S',
'T',
'A',
'U'):
384 if (tag ==
MKTAG(
'F',
'F',
'M',
'2'))
386 if (tag !=
MKTAG(
'F',
'F',
'M',
'1'))
398 ffm->
file_size = (UINT64_C(1) << 63) - 1;
436 avio_get_str(pb, INT_MAX, rc_eq_buf,
sizeof(rc_eq_buf));
512 av_dlog(s,
"pos=%08"PRIx64
" spos=%"PRIx64
", write_index=%"PRIx64
" size=%"PRIx64
"\n",
566 int64_t pos_min, pos_max, pos;
567 int64_t pts_min, pts_max, pts;
570 av_dlog(s,
"wanted_pts=%0.6f\n", wanted_pts / 1000000.0);
585 while (pos_min <= pos_max) {
588 if (pts_min > wanted_pts || pts_max <= wanted_pts) {
589 pos = pts_min > wanted_pts ? pos_min : pos_max;
593 pos1 = (double)(pos_max - pos_min) * (double)(wanted_pts - pts_min) /
594 (double)(pts_max - pts_min);
598 else if (pos >= pos_max)
602 if (pts == wanted_pts) {
604 }
else if (pts > wanted_pts) {
628 p->
buf[0] ==
'F' && p->
buf[1] ==
'F' && p->
buf[2] ==
'M' &&
629 (p->
buf[3] ==
'1' || p->
buf[3] ==
'2'))