Revision a2704c97 libavformat/mxfdec.c

View differences:

libavformat/mxfdec.c
193 193
{
194 194
    if (!mxf_read_sync(pb, mxf_klv_key, 4))
195 195
        return -1;
196
    klv->offset = url_ftell(pb) - 4;
196
    klv->offset = avio_tell(pb) - 4;
197 197
    memcpy(klv->key, mxf_klv_key, 4);
198 198
    avio_read(pb, klv->key + 4, 12);
199 199
    klv->length = klv_decode_ber_length(pb);
......
247 247
    static const uint8_t checkv[16] = {0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b};
248 248
    MXFContext *mxf = s->priv_data;
249 249
    AVIOContext *pb = s->pb;
250
    int64_t end = url_ftell(pb) + klv->length;
250
    int64_t end = avio_tell(pb) + klv->length;
251 251
    uint64_t size;
252 252
    uint64_t orig_size;
253 253
    uint64_t plaintext_size;
......
297 297
                     &pkt->data[plaintext_size], size >> 4, ivec, 1);
298 298
    pkt->size = orig_size;
299 299
    pkt->stream_index = index;
300
    avio_seek(pb, end - url_ftell(pb), SEEK_CUR);
300
    avio_seek(pb, end - avio_tell(pb), SEEK_CUR);
301 301
    return 0;
302 302
}
303 303

  
......
866 866
{
867 867
    AVIOContext *pb = mxf->fc->pb;
868 868
    MXFMetadataSet *ctx = ctx_size ? av_mallocz(ctx_size) : mxf;
869
    uint64_t klv_end = url_ftell(pb) + klv->length;
869
    uint64_t klv_end = avio_tell(pb) + klv->length;
870 870

  
871 871
    if (!ctx)
872 872
        return -1;
873
    while (url_ftell(pb) + 4 < klv_end) {
873
    while (avio_tell(pb) + 4 < klv_end) {
874 874
        int tag = avio_rb16(pb);
875 875
        int size = avio_rb16(pb); /* KLV specified by 0x53 */
876
        uint64_t next = url_ftell(pb) + size;
876
        uint64_t next = avio_tell(pb) + size;
877 877
        UID uid = {0};
878 878

  
879 879
        av_dlog(mxf->fc, "local tag %#04x size %d\n", tag, size);

Also available in: Unified diff