Revision 384c9c2f libavformat/avidec.c

View differences:

libavformat/avidec.c
109 109
    /* check RIFF header */
110 110
    avio_read(pb, header, 4);
111 111
    avi->riff_end = avio_rl32(pb);  /* RIFF chunk size */
112
    avi->riff_end += url_ftell(pb); /* RIFF chunk end */
112
    avi->riff_end += avio_tell(pb); /* RIFF chunk end */
113 113
    avio_read(pb, header+4, 4);
114 114

  
115 115
    for(i=0; avi_headers[i][0]; i++)
......
198 198
            if(url_feof(pb))
199 199
                return -1;
200 200

  
201
            pos = url_ftell(pb);
201
            pos = avio_tell(pb);
202 202

  
203 203
            if(avi->odml_depth > MAX_ODML_DEPTH){
204 204
                av_log(s, AV_LOG_ERROR, "Too deeply nested ODML indexes\n");
......
267 267

  
268 268
static void avi_read_info(AVFormatContext *s, uint64_t end)
269 269
{
270
    while (url_ftell(s->pb) < end) {
270
    while (avio_tell(s->pb) < end) {
271 271
        uint32_t tag  = avio_rl32(s->pb);
272 272
        uint32_t size = avio_rl32(s->pb);
273 273
        avi_read_tag(s, NULL, tag, size);
......
298 298

  
299 299
static void avi_read_nikon(AVFormatContext *s, uint64_t end)
300 300
{
301
    while (url_ftell(s->pb) < end) {
301
    while (avio_tell(s->pb) < end) {
302 302
        uint32_t tag  = avio_rl32(s->pb);
303 303
        uint32_t size = avio_rl32(s->pb);
304 304
        switch (tag) {
305 305
        case MKTAG('n', 'c', 't', 'g'): {  /* Nikon Tags */
306
            uint64_t tag_end = url_ftell(s->pb) + size;
307
            while (url_ftell(s->pb) < tag_end) {
306
            uint64_t tag_end = avio_tell(s->pb) + size;
307
            while (avio_tell(s->pb) < tag_end) {
308 308
                uint16_t tag  = avio_rl16(s->pb);
309 309
                uint16_t size = avio_rl16(s->pb);
310 310
                const char *name = NULL;
......
369 369

  
370 370
        switch(tag) {
371 371
        case MKTAG('L', 'I', 'S', 'T'):
372
            list_end = url_ftell(pb) + size;
372
            list_end = avio_tell(pb) + size;
373 373
            /* Ignored, except at start of video packets. */
374 374
            tag1 = avio_rl32(pb);
375 375

  
376 376
            print_tag("list", tag1, 0);
377 377

  
378 378
            if (tag1 == MKTAG('m', 'o', 'v', 'i')) {
379
                avi->movi_list = url_ftell(pb) - 4;
379
                avi->movi_list = avio_tell(pb) - 4;
380 380
                if(size) avi->movi_end = avi->movi_list + size + (size & 1);
381 381
                else     avi->movi_end = url_fsize(pb);
382 382
                av_dlog(NULL, "movi end=%"PRIx64"\n", avi->movi_end);
......
549 549
            if (stream_index >= (unsigned)s->nb_streams || avi->dv_demux) {
550 550
                avio_seek(pb, size, SEEK_CUR);
551 551
            } else {
552
                uint64_t cur_pos = url_ftell(pb);
552
                uint64_t cur_pos = avio_tell(pb);
553 553
                if (cur_pos < list_end)
554 554
                    size = FFMIN(size, list_end - cur_pos);
555 555
                st = s->streams[stream_index];
......
664 664
            }
665 665
            break;
666 666
        case MKTAG('i', 'n', 'd', 'x'):
667
            i= url_ftell(pb);
667
            i= avio_tell(pb);
668 668
            if(!url_is_streamed(pb) && !(s->flags & AVFMT_FLAG_IGNIDX)){
669 669
                read_braindead_odml_indx(s, 0);
670 670
            }
......
704 704
            if(size > 1000000){
705 705
                av_log(s, AV_LOG_ERROR, "Something went wrong during header parsing, "
706 706
                                        "I will ignore it and try to continue anyway.\n");
707
                avi->movi_list = url_ftell(pb) - 4;
707
                avi->movi_list = avio_tell(pb) - 4;
708 708
                avi->movi_end  = url_fsize(pb);
709 709
                goto end_of_header;
710 710
            }
......
923 923

  
924 924
        if(size > ast->remaining)
925 925
            size= ast->remaining;
926
        avi->last_pkt_pos= url_ftell(pb);
926
        avi->last_pkt_pos= avio_tell(pb);
927 927
        err= av_get_packet(pb, pkt, size);
928 928
        if(err<0)
929 929
            return err;
......
989 989
    }
990 990

  
991 991
    memset(d, -1, sizeof(int)*8);
992
    for(i=sync=url_ftell(pb); !url_feof(pb); i++) {
992
    for(i=sync=avio_tell(pb); !url_feof(pb); i++) {
993 993
        int j;
994 994

  
995 995
        for(j=0; j<7; j++)
......
1092 1092
                ast->remaining= size;
1093 1093

  
1094 1094
                if(size || !ast->sample_size){
1095
                    uint64_t pos= url_ftell(pb) - 8;
1095
                    uint64_t pos= avio_tell(pb) - 8;
1096 1096
                    if(!st->index_entries || !st->nb_index_entries || st->index_entries[st->nb_index_entries - 1].pos < pos){
1097 1097
                        av_add_index_entry(st, pos, ast->frame_offset, size, 0, AVINDEX_KEYFRAME);
1098 1098
                    }
......
1162 1162
    int i;
1163 1163
    int64_t last_start=0;
1164 1164
    int64_t first_end= INT64_MAX;
1165
    int64_t oldpos= url_ftell(s->pb);
1165
    int64_t oldpos= avio_tell(s->pb);
1166 1166

  
1167 1167
    for(i=0; i<s->nb_streams; i++){
1168 1168
        AVStream *st = s->streams[i];
......
1194 1194
    AVIContext *avi = s->priv_data;
1195 1195
    AVIOContext *pb = s->pb;
1196 1196
    uint32_t tag, size;
1197
    int64_t pos= url_ftell(pb);
1197
    int64_t pos= avio_tell(pb);
1198 1198
    int ret = -1;
1199 1199

  
1200 1200
    if (avio_seek(pb, avi->movi_end, SEEK_SET) < 0)

Also available in: Unified diff