Revision e356fc57 libavformat/flvdec.c

View differences:

libavformat/flvdec.c
113 113
static int amf_get_string(AVIOContext *ioc, char *buffer, int buffsize) {
114 114
    int length = avio_rb16(ioc);
115 115
    if(length >= buffsize) {
116
        url_fskip(ioc, length);
116
        avio_seek(ioc, length, SEEK_CUR);
117 117
        return -1;
118 118
    }
119 119

  
......
149 149
            unsigned int keylen;
150 150

  
151 151
            while(url_ftell(ioc) < max_pos - 2 && (keylen = avio_rb16(ioc))) {
152
                url_fskip(ioc, keylen); //skip key string
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.
155 155
            }
......
162 162
        case AMF_DATA_TYPE_UNSUPPORTED:
163 163
            break; //these take up no additional space
164 164
        case AMF_DATA_TYPE_MIXEDARRAY:
165
            url_fskip(ioc, 4); //skip 32-bit max array index
165
            avio_seek(ioc, 4, SEEK_CUR); //skip 32-bit max array index
166 166
            while(url_ftell(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)
......
182 182
        }
183 183
            break;
184 184
        case AMF_DATA_TYPE_DATE:
185
            url_fskip(ioc, 8 + 2); //timestamp (double) and UTC offset (int16)
185
            avio_seek(ioc, 8 + 2, SEEK_CUR); //timestamp (double) and UTC offset (int16)
186 186
            break;
187 187
        default: //unsupported type, we couldn't skip
188 188
            return -1;
......
254 254
{
255 255
    int offset, flags;
256 256

  
257
    url_fskip(s->pb, 4);
257
    avio_seek(s->pb, 4, SEEK_CUR);
258 258
    flags = avio_r8(s->pb);
259 259
    /* old flvtool cleared this field */
260 260
    /* FIXME: better fix needed */
......
278 278

  
279 279
    offset = avio_rb32(s->pb);
280 280
    avio_seek(s->pb, offset, SEEK_SET);
281
    url_fskip(s->pb, 4);
281
    avio_seek(s->pb, 4, SEEK_CUR);
282 282

  
283 283
    s->start_time = 0;
284 284

  
......
304 304
    int64_t dts, pts = AV_NOPTS_VALUE;
305 305
    AVStream *st = NULL;
306 306

  
307
 for(;;url_fskip(s->pb, 4)){ /* pkt size is repeated at end. skip it */
307
 for(;;avio_seek(s->pb, 4, SEEK_CUR)){ /* pkt size is repeated at end. skip it */
308 308
    pos = url_ftell(s->pb);
309 309
    type = avio_r8(s->pb);
310 310
    size = avio_rb24(s->pb);
......
313 313
//    av_log(s, AV_LOG_DEBUG, "type:%d, size:%d, dts:%d\n", type, size, dts);
314 314
    if (url_feof(s->pb))
315 315
        return AVERROR_EOF;
316
    url_fskip(s->pb, 3); /* stream id, always 0 */
316
    avio_seek(s->pb, 3, SEEK_CUR); /* stream id, always 0 */
317 317
    flags = 0;
318 318

  
319 319
    if(size == 0)
......
454 454
        pkt->flags |= AV_PKT_FLAG_KEY;
455 455

  
456 456
leave:
457
    url_fskip(s->pb, 4);
457
    avio_seek(s->pb, 4, SEEK_CUR);
458 458
    return ret;
459 459
}
460 460

  

Also available in: Unified diff