Revision a2704c97 libavformat/cafdec.c

View differences:

libavformat/cafdec.c
106 106
        int strt, skip;
107 107
        MOVAtom atom;
108 108

  
109
        strt = url_ftell(pb);
109
        strt = avio_tell(pb);
110 110
        ff_mov_read_esds(s, pb, atom);
111
        skip = size - (url_ftell(pb) - strt);
111
        skip = size - (avio_tell(pb) - strt);
112 112
        if (skip < 0 || !st->codec->extradata ||
113 113
            st->codec->codec_id != CODEC_ID_AAC) {
114 114
            av_log(s, AV_LOG_ERROR, "invalid AAC magic cookie\n");
......
150 150
    int64_t pos = 0, ccount;
151 151
    int num_packets, i;
152 152

  
153
    ccount = url_ftell(pb);
153
    ccount = avio_tell(pb);
154 154

  
155 155
    num_packets = avio_rb64(pb);
156 156
    if (num_packets < 0 || INT32_MAX / sizeof(AVIndexEntry) < num_packets)
......
167 167
        st->duration += caf->frames_per_packet ? caf->frames_per_packet : ff_mp4_read_descr_len(pb);
168 168
    }
169 169

  
170
    if (url_ftell(pb) - ccount != size) {
170
    if (avio_tell(pb) - ccount != size) {
171 171
        av_log(s, AV_LOG_ERROR, "error reading packet table\n");
172 172
        return -1;
173 173
    }
......
234 234
        switch (tag) {
235 235
        case MKBETAG('d','a','t','a'):
236 236
            avio_seek(pb, 4, SEEK_CUR); /* edit count */
237
            caf->data_start = url_ftell(pb);
237
            caf->data_start = avio_tell(pb);
238 238
            caf->data_size  = size < 0 ? -1 : size - 4;
239 239
            if (caf->data_size > 0 && !url_is_streamed(pb))
240 240
                avio_seek(pb, caf->data_size, SEEK_CUR);
......
312 312

  
313 313
    /* don't read past end of data chunk */
314 314
    if (caf->data_size > 0) {
315
        left = (caf->data_start + caf->data_size) - url_ftell(pb);
315
        left = (caf->data_start + caf->data_size) - avio_tell(pb);
316 316
        if (left <= 0)
317 317
            return AVERROR(EIO);
318 318
    }

Also available in: Unified diff