Lines Matching defs:wtv
37 #include "wtv.h"
561 WtvContext *wtv = s->priv_data;
562 AVIOContext *pb = wtv->pb;
638 WtvContext *wtv = s->priv_data;
639 AVIOContext *pb = wtv->pb;
757 static int recover(WtvContext *wtv, uint64_t broken_pos)
759 AVIOContext *pb = wtv->pb;
761 for (i = 0; i < wtv->nb_index_entries; i++) {
762 if (wtv->index_entries[i].pos > broken_pos) {
763 int64_t ret = avio_seek(pb, wtv->index_entries[i].pos, SEEK_SET);
766 wtv->pts = wtv->index_entries[i].timestamp;
782 WtvContext *wtv = s->priv_data;
783 AVIOContext *pb = wtv->pb;
795 if ((ret = recover(wtv, avio_tell(pb) - 20)) < 0)
900 wtv->pts = avio_rl64(pb);
902 if (wtv->pts == -1)
903 wtv->pts = AV_NOPTS_VALUE;
905 wtv->last_valid_pts = wtv->pts;
906 if (wtv->epoch == AV_NOPTS_VALUE || wtv->pts < wtv->epoch)
907 wtv->epoch = wtv->pts;
908 if (mode == SEEK_TO_PTS && wtv->pts >= seekts) {
963 WtvContext *wtv = s->priv_data;
971 wtv->epoch =
972 wtv->pts =
973 wtv->last_valid_pts = AV_NOPTS_VALUE;
993 wtv->pb = wtvfile_open(s, root, root_size, ff_timeline_le16);
994 if (!wtv->pb) {
1001 wtvfile_close(wtv->pb);
1004 avio_seek(wtv->pb, -32, SEEK_CUR);
1015 s->ctx_flags |= AVFMTCTX_NOHEADER; // Needed for noStreams.wtv
1027 ff_add_index_entry(&wtv->index_entries, &wtv->nb_index_entries, &wtv->index_entries_allocated_size,
1032 if (wtv->nb_index_entries) {
1035 AVIndexEntry *e = wtv->index_entries;
1036 AVIndexEntry *e_end = wtv->index_entries + wtv->nb_index_entries - 1;
1063 WtvContext *wtv = s->priv_data;
1064 AVIOContext *pb = wtv->pb;
1075 pkt->pts = wtv->pts;
1083 WtvContext *wtv = s->priv_data;
1084 AVIOContext *pb = wtv->pb;
1092 /* timestamp adjustment is required because wtv->pts values are absolute,
1095 if (wtv->epoch != AV_NOPTS_VALUE)
1096 ts_relative -= wtv->epoch;
1098 i = ff_index_search_timestamp(wtv->index_entries, wtv->nb_index_entries, ts_relative, flags);
1100 if (wtv->last_valid_pts == AV_NOPTS_VALUE || ts < wtv->last_valid_pts) {
1103 } else if (st->duration != AV_NOPTS_VALUE && ts_relative > st->duration && wtv->nb_index_entries) {
1104 if (avio_seek(pb, wtv->index_entries[wtv->nb_index_entries - 1].pos, SEEK_SET) < 0)
1111 if (avio_seek(pb, wtv->index_entries[i].pos, SEEK_SET) < 0)
1113 wtv->pts = wtv->index_entries[i].timestamp;
1114 if (wtv->epoch != AV_NOPTS_VALUE)
1115 wtv->pts += wtv->epoch;
1116 wtv->last_valid_pts = wtv->pts;
1122 WtvContext *wtv = s->priv_data;
1123 av_freep(&wtv->index_entries);
1124 wtvfile_close(wtv->pb);
1129 .name = "wtv",