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) {
250 ffm->
file_size = (UINT64_C(1) << 63) - 1;
263 case MKBETAG(
'M',
'A',
'I',
'N'):
267 case MKBETAG(
'C',
'O',
'M',
'M'):
291 case MKBETAG(
'S',
'T',
'V',
'I'):
304 avio_get_str(pb, INT_MAX, rc_eq_buf,
sizeof(rc_eq_buf));
337 case MKBETAG(
'S',
'T',
'A',
'U'):
376 if (tag ==
MKTAG(
'F',
'F',
'M',
'2'))
378 if (tag !=
MKTAG(
'F',
'F',
'M',
'1'))
390 ffm->
file_size = (UINT64_C(1) << 63) - 1;
396 for(i=0;i<nb_streams;i++) {
428 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'))