34 lseek(fd, 8, SEEK_SET);
35 if (read(fd, buf, 8) != 8)
46 buf[i] = (pos >> (56 - i * 8)) & 0xff;
47 lseek(fd, 8, SEEK_SET);
48 if (write(fd, buf, 8) != 8)
59 #endif // CONFIG_AVSERVER
64 int64_t pos, avail_size;
79 }
else if (pos < ffm->write_index) {
86 if (size <= avail_size)
107 uint8_t *buf,
int size,
int header)
111 int len, fill_size, size1, frame_offset,
id;
178 av_dlog(s,
"seek to %"PRIx64
" -> %"PRIx64
"\n", pos1, pos);
190 av_dlog(s,
"dts=%0.6f\n", dts / 1000000.0);
200 int64_t pos_min, pos_max;
208 pts_start =
get_dts(s, pos_min);
212 if (pts - 100000 > pts_start)
217 pts_start =
get_dts(s, pos_min);
221 if (pts - 100000 <= pts_start) {
228 if (newpos == pos_min)
233 if (newpts - 100000 <= pts) {
273 if (tag !=
MKTAG(
'F',
'F',
'M',
'1'))
285 ffm->
file_size = (UINT64_C(1) << 63) - 1;
291 for(i=0;i<nb_streams;i++) {
323 avio_get_str(pb, INT_MAX, rc_eq_buf,
sizeof(rc_eq_buf));
405 av_dlog(s,
"pos=%08"PRIx64
" spos=%"PRIx64
", write_index=%"PRIx64
" size=%"PRIx64
"\n",
457 int64_t pos_min, pos_max, pos;
458 int64_t pts_min, pts_max, pts;
461 av_dlog(s,
"wanted_pts=%0.6f\n", wanted_pts / 1000000.0);
466 while (pos_min <= pos_max) {
470 pos1 = (double)(pos_max - pos_min) * (double)(wanted_pts - pts_min) /
471 (double)(pts_max - pts_min);
475 else if (pos >= pos_max)
479 if (pts == wanted_pts) {
481 }
else if (pts > wanted_pts) {
504 p->
buf[0] ==
'F' && p->
buf[1] ==
'F' && p->
buf[2] ==
'M' &&