32 int64_t pos, avail_size;
54 if (size <= avail_size)
79 int len, fill_size, size1, frame_offset,
id;
151 av_dlog(s,
"seek to %"PRIx64
" -> %"PRIx64
"\n", pos1, pos);
163 av_dlog(s,
"dts=%0.6f\n", dts / 1000000.0);
173 int64_t pos_min, pos_max;
181 pts_start =
get_dts(s, pos_min);
185 if (pts - 100000 > pts_start)
190 pts_start =
get_dts(s, pos_min);
194 if (pts - 100000 <= pts_start) {
201 if (newpos == pos_min)
206 if (newpts - 100000 <= pts) {
248 ffm->
file_size = (UINT64_C(1) << 63) - 1;
261 case MKBETAG(
'M',
'A',
'I',
'N'):
265 case MKBETAG(
'C',
'O',
'M',
'M'):
290 case MKBETAG(
'S',
'T',
'V',
'I'):
303 avio_get_str(pb, INT_MAX, rc_eq_buf,
sizeof(rc_eq_buf));
336 case MKBETAG(
'S',
'T',
'A',
'U'):
375 if (tag ==
MKTAG(
'F',
'F',
'M',
'2'))
377 if (tag !=
MKTAG(
'F',
'F',
'M',
'1'))
389 ffm->
file_size = (UINT64_C(1) << 63) - 1;
395 for(i=0;i<nb_streams;i++) {
427 avio_get_str(pb, INT_MAX, rc_eq_buf,
sizeof(rc_eq_buf));
504 av_dlog(s,
"pos=%08"PRIx64
" spos=%"PRIx64
", write_index=%"PRIx64
" size=%"PRIx64
"\n",
558 int64_t pos_min, pos_max, pos;
559 int64_t pts_min, pts_max, pts;
562 av_dlog(s,
"wanted_pts=%0.6f\n", wanted_pts / 1000000.0);
577 while (pos_min <= pos_max) {
580 if (pts_min > wanted_pts || pts_max <= wanted_pts) {
581 pos = pts_min > wanted_pts ? pos_min : pos_max;
585 pos1 = (double)(pos_max - pos_min) * (double)(wanted_pts - pts_min) /
586 (double)(pts_max - pts_min);
590 else if (pos >= pos_max)
594 if (pts == wanted_pts) {
596 }
else if (pts > wanted_pts) {
620 p->
buf[0] ==
'F' && p->
buf[1] ==
'F' && p->
buf[2] ==
'M' &&
621 (p->
buf[3] ==
'1' || p->
buf[3] ==
'2'))