X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Ftta.c;h=46c2508bcec583e285d412f67ba1d4e69d599dfe;hb=930391e5988abe126d29c5e9b09fab459e0b8936;hp=ae90a85544c4609a3edbfe8d906445ae0137f54c;hpb=03210fe138f3b3bd7f5272fe29aca810cf517329;p=ffmpeg diff --git a/libavformat/tta.c b/libavformat/tta.c index ae90a85544c..46c2508bcec 100644 --- a/libavformat/tta.c +++ b/libavformat/tta.c @@ -35,7 +35,7 @@ typedef struct TTAContext { int last_frame_size; } TTAContext; -static int tta_probe(AVProbeData *p) +static int tta_probe(const AVProbeData *p) { if (AV_RL32(&p->buf[0]) == MKTAG('T', 'T', 'A', '1') && (AV_RL16(&p->buf[4]) == 1 || AV_RL16(&p->buf[4]) == 2) && @@ -119,7 +119,7 @@ static int tta_read_header(AVFormatContext *s) for (i = 0; i < c->totalframes; i++) { uint32_t size = avio_rl32(s->pb); int r; - if ((r = av_add_index_entry(st, framepos, i * c->frame_size, size, 0, + if ((r = av_add_index_entry(st, framepos, i * (int64_t)c->frame_size, size, 0, AVINDEX_KEYFRAME)) < 0) return r; framepos += size; @@ -155,15 +155,15 @@ static int tta_read_packet(AVFormatContext *s, AVPacket *pkt) if (c->currentframe >= c->totalframes) return AVERROR_EOF; - if (st->nb_index_entries < c->totalframes) { + if (st->internal->nb_index_entries < c->totalframes) { av_log(s, AV_LOG_ERROR, "Index entry disappeared\n"); return AVERROR_INVALIDDATA; } - size = st->index_entries[c->currentframe].size; + size = st->internal->index_entries[c->currentframe].size; ret = av_get_packet(s->pb, pkt, size); - pkt->dts = st->index_entries[c->currentframe++].timestamp; + pkt->dts = st->internal->index_entries[c->currentframe++].timestamp; pkt->duration = c->currentframe == c->totalframes ? c->last_frame_size : c->frame_size; return ret; @@ -176,7 +176,7 @@ static int tta_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp int index = av_index_search_timestamp(st, timestamp, flags); if (index < 0) return -1; - if (avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET) < 0) + if (avio_seek(s->pb, st->internal->index_entries[index].pos, SEEK_SET) < 0) return -1; c->currentframe = index;