Lines Matching defs:pos
38 int ffm_write_write_index(int fd, int64_t pos)
44 buf[i] = (pos >> (56 - i * 8)) & 0xff;
51 void ffm_set_write_index(AVFormatContext *s, int64_t pos, int64_t file_size)
54 ffm->write_index = pos;
62 int64_t pos, avail_size;
68 pos = url_ftell(s->pb);
69 if (pos == ffm->write_index) {
72 } else if (pos < ffm->write_index) {
73 avail_size = ffm->write_index - pos;
75 avail_size = (ffm->file_size - pos) + (ffm->write_index - FFM_PACKET_SIZE);
146 /* pos is between 0 and file_size - FFM_PACKET_SIZE. It is translated
152 int64_t pos;
154 pos = pos1 + ffm->write_index;
155 if (pos >= ffm->file_size)
156 pos -= (ffm->file_size - FFM_PACKET_SIZE);
158 av_log(s, AV_LOG_DEBUG, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos);
160 url_fseek(pb, pos, SEEK_SET);
163 static int64_t get_dts(AVFormatContext *s, int64_t pos)
168 ffm_seek1(s, pos);
373 dprintf(s, "pos=%08"PRIx64" spos=%"PRIx64", write_index=%"PRIx64" size=%"PRIx64"\n",
374 url_ftell(s->pb), s->pb->pos, ffm->write_index, ffm->file_size);
402 pkt->pos = url_ftell(s->pb);
429 int64_t pos_min, pos_max, pos;
446 pos = (((int64_t)pos1) / FFM_PACKET_SIZE) * FFM_PACKET_SIZE;
447 if (pos <= pos_min)
448 pos = pos_min;
449 else if (pos >= pos_max)
450 pos = pos_max;
451 pts = get_dts(s, pos);
456 pos_max = pos - FFM_PACKET_SIZE;
458 pos_min = pos + FFM_PACKET_SIZE;
461 pos = (flags & AVSEEK_FLAG_BACKWARD) ? pos_min : pos_max;
462 if (pos > 0)
463 pos -= FFM_PACKET_SIZE;
465 ffm_seek1(s, pos);