Revision a2704c97 libavformat/flvdec.c

View differences:

libavformat/flvdec.c
148 148
        case AMF_DATA_TYPE_OBJECT: {
149 149
            unsigned int keylen;
150 150

  
151
            while(url_ftell(ioc) < max_pos - 2 && (keylen = avio_rb16(ioc))) {
151
            while(avio_tell(ioc) < max_pos - 2 && (keylen = avio_rb16(ioc))) {
152 152
                avio_seek(ioc, keylen, SEEK_CUR); //skip key string
153 153
                if(amf_parse_object(s, NULL, NULL, NULL, max_pos, depth + 1) < 0)
154 154
                    return -1; //if we couldn't skip, bomb out.
......
163 163
            break; //these take up no additional space
164 164
        case AMF_DATA_TYPE_MIXEDARRAY:
165 165
            avio_seek(ioc, 4, SEEK_CUR); //skip 32-bit max array index
166
            while(url_ftell(ioc) < max_pos - 2 && amf_get_string(ioc, str_val, sizeof(str_val)) > 0) {
166
            while(avio_tell(ioc) < max_pos - 2 && amf_get_string(ioc, str_val, sizeof(str_val)) > 0) {
167 167
                //this is the only case in which we would want a nested parse to not skip over the object
168 168
                if(amf_parse_object(s, astream, vstream, str_val, max_pos, depth + 1) < 0)
169 169
                    return -1;
......
175 175
            unsigned int arraylen, i;
176 176

  
177 177
            arraylen = avio_rb32(ioc);
178
            for(i = 0; i < arraylen && url_ftell(ioc) < max_pos - 1; i++) {
178
            for(i = 0; i < arraylen && avio_tell(ioc) < max_pos - 1; i++) {
179 179
                if(amf_parse_object(s, NULL, NULL, NULL, max_pos, depth + 1) < 0)
180 180
                    return -1; //if we couldn't skip, bomb out.
181 181
            }
......
305 305
    AVStream *st = NULL;
306 306

  
307 307
 for(;;avio_seek(s->pb, 4, SEEK_CUR)){ /* pkt size is repeated at end. skip it */
308
    pos = url_ftell(s->pb);
308
    pos = avio_tell(s->pb);
309 309
    type = avio_r8(s->pb);
310 310
    size = avio_rb24(s->pb);
311 311
    dts = avio_rb24(s->pb);
......
319 319
    if(size == 0)
320 320
        continue;
321 321

  
322
    next= size + url_ftell(s->pb);
322
    next= size + avio_tell(s->pb);
323 323

  
324 324
    if (type == FLV_TAG_TYPE_AUDIO) {
325 325
        is_audio=1;
......
372 372
    // if not streamed and no duration from metadata then seek to end to find the duration from the timestamps
373 373
    if(!url_is_streamed(s->pb) && (!s->duration || s->duration==AV_NOPTS_VALUE)){
374 374
        int size;
375
        const int64_t pos= url_ftell(s->pb);
375
        const int64_t pos= avio_tell(s->pb);
376 376
        const int64_t fsize= url_fsize(s->pb);
377 377
        avio_seek(s->pb, fsize-4, SEEK_SET);
378 378
        size= avio_rb32(s->pb);

Also available in: Unified diff