Revision e356fc57 libavformat/mov.c

View differences:

libavformat/mov.c
296 296
            parse = mov_read_udta_string;
297 297

  
298 298
        if (!parse) { /* skip leaf atoms data */
299
            url_fskip(pb, a.size);
299
            avio_seek(pb, a.size, SEEK_CUR);
300 300
        } else {
301 301
            int64_t start_pos = url_ftell(pb);
302 302
            int64_t left;
......
308 308
                return 0;
309 309
            left = a.size - url_ftell(pb) + start_pos;
310 310
            if (left > 0) /* skip garbage at atom end */
311
                url_fskip(pb, left);
311
                avio_seek(pb, left, SEEK_CUR);
312 312
        }
313 313

  
314 314
        total_size += a.size;
315 315
    }
316 316

  
317 317
    if (total_size < atom.size && atom.size < 0x7ffff)
318
        url_fskip(pb, atom.size - total_size);
318
        avio_seek(pb, atom.size - total_size, SEEK_CUR);
319 319

  
320 320
    return 0;
321 321
}
......
357 357
            uint16_t volume_len, len;
358 358
            int16_t type;
359 359

  
360
            url_fskip(pb, 10);
360
            avio_seek(pb, 10, SEEK_CUR);
361 361

  
362 362
            volume_len = avio_r8(pb);
363 363
            volume_len = FFMIN(volume_len, 27);
......
365 365
            dref->volume[volume_len] = 0;
366 366
            av_log(c->fc, AV_LOG_DEBUG, "volume %s, len %d\n", dref->volume, volume_len);
367 367

  
368
            url_fskip(pb, 12);
368
            avio_seek(pb, 12, SEEK_CUR);
369 369

  
370 370
            len = avio_r8(pb);
371 371
            len = FFMIN(len, 63);
......
373 373
            dref->filename[len] = 0;
374 374
            av_log(c->fc, AV_LOG_DEBUG, "filename %s, len %d\n", dref->filename, len);
375 375

  
376
            url_fskip(pb, 16);
376
            avio_seek(pb, 16, SEEK_CUR);
377 377

  
378 378
            /* read next level up_from_alias/down_to_target */
379 379
            dref->nlvl_from = avio_rb16(pb);
......
381 381
            av_log(c->fc, AV_LOG_DEBUG, "nlvl from %d, nlvl to %d\n",
382 382
                   dref->nlvl_from, dref->nlvl_to);
383 383

  
384
            url_fskip(pb, 16);
384
            avio_seek(pb, 16, SEEK_CUR);
385 385

  
386 386
            for (type = 0; type != -1 && url_ftell(pb) < next; ) {
387 387
                type = avio_rb16(pb);
......
416 416
                            dref->dir[j] = '/';
417 417
                    av_log(c->fc, AV_LOG_DEBUG, "dir %s\n", dref->dir);
418 418
                } else
419
                    url_fskip(pb, len);
419
                    avio_seek(pb, len, SEEK_CUR);
420 420
            }
421 421
        }
422 422
        avio_seek(pb, next, SEEK_SET);
......
663 663

  
664 664
    avio_rb16(pb); /* preferred volume */
665 665

  
666
    url_fskip(pb, 10); /* reserved */
666
    avio_seek(pb, 10, SEEK_CUR); /* reserved */
667 667

  
668
    url_fskip(pb, 36); /* display matrix */
668
    avio_seek(pb, 36, SEEK_CUR); /* display matrix */
669 669

  
670 670
    avio_rb32(pb); /* preview time */
671 671
    avio_rb32(pb); /* preview duration */
......
782 782
        if (mov_read_default(c, pb, atom) < 0)
783 783
            return -1;
784 784
    } else
785
        url_fskip(pb, atom.size);
785
        avio_seek(pb, atom.size, SEEK_CUR);
786 786
    return 0;
787 787
}
788 788

  
......
833 833
    if (!st->codec->extradata)
834 834
        return AVERROR(ENOMEM);
835 835
    st->codec->extradata_size = atom.size - 40;
836
    url_fskip(pb, 40);
836
    avio_seek(pb, 40, SEEK_CUR);
837 837
    avio_read(pb, st->codec->extradata, atom.size - 40);
838 838
    return 0;
839 839
}
......
945 945
             * in the MOV demuxer, patch welcome. */
946 946
        multiple_stsd:
947 947
            av_log(c->fc, AV_LOG_WARNING, "multiple fourcc not supported\n");
948
            url_fskip(pb, size - (url_ftell(pb) - start_pos));
948
            avio_seek(pb, size - (url_ftell(pb) - start_pos), SEEK_CUR);
949 949
            continue;
950 950
        }
951 951
        /* we cannot demux concatenated h264 streams because of different extradata */
......
1003 1003
                len = 31;
1004 1004
            mov_read_mac_string(c, pb, len, st->codec->codec_name, 32);
1005 1005
            if (len < 31)
1006
                url_fskip(pb, 31 - len);
1006
                avio_seek(pb, 31 - len, SEEK_CUR);
1007 1007
            /* codec_tag YV12 triggers an UV swap in rawdec.c */
1008 1008
            if (!memcmp(st->codec->codec_name, "Planar Y'CbCr 8-bit 4:2:0", 25))
1009 1009
                st->codec->codec_tag=MKTAG('I', '4', '2', '0');
......
1174 1174
            st->codec->height = sc->height;
1175 1175
        } else {
1176 1176
            /* other codec type, just skip (rtp, mp4s, tmcd ...) */
1177
            url_fskip(pb, size - (url_ftell(pb) - start_pos));
1177
            avio_seek(pb, size - (url_ftell(pb) - start_pos), SEEK_CUR);
1178 1178
        }
1179 1179
        /* this will read extra atoms at the end (wave, alac, damr, avcC, SMI ...) */
1180 1180
        a.size = size - (url_ftell(pb) - start_pos);
......
1182 1182
            if (mov_read_default(c, pb, a) < 0)
1183 1183
                return -1;
1184 1184
        } else if (a.size > 0)
1185
            url_fskip(pb, a.size);
1185
            avio_seek(pb, a.size, SEEK_CUR);
1186 1186
    }
1187 1187

  
1188 1188
    if(st->codec->codec_type==AVMEDIA_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1)
......
2078 2078
    if (atom.size < 8)
2079 2079
        return 0; /* continue */
2080 2080
    if (avio_rb32(pb) != 0) { /* 0 sized mdat atom... use the 'wide' atom size */
2081
        url_fskip(pb, atom.size - 4);
2081
        avio_seek(pb, atom.size - 4, SEEK_CUR);
2082 2082
        return 0;
2083 2083
    }
2084 2084
    atom.type = avio_rl32(pb);
2085 2085
    atom.size -= 8;
2086 2086
    if (atom.type != MKTAG('m','d','a','t')) {
2087
        url_fskip(pb, atom.size);
2087
        avio_seek(pb, atom.size, SEEK_CUR);
2088 2088
        return 0;
2089 2089
    }
2090 2090
    err = mov_read_mdat(c, pb, atom);

Also available in: Unified diff