Revision f59d8ff8 libavformat/wtv.c

View differences:

libavformat/wtv.c
98 98
            int i = wf->position >> wf->sector_bits;
99 99
            if (i >= wf->nb_sectors ||
100 100
                (wf->sectors[i] != wf->sectors[i - 1] + (1 << (wf->sector_bits - WTV_SECTOR_BITS)) &&
101
                url_fseek(pb, (int64_t)wf->sectors[i] << WTV_SECTOR_BITS, SEEK_SET) < 0)) {
101
                avio_seek(pb, (int64_t)wf->sectors[i] << WTV_SECTOR_BITS, SEEK_SET) < 0)) {
102 102
                wf->error = 1;
103 103
                break;
104 104
            }
......
123 123
        offset = wf->length;
124 124

  
125 125
    wf->error = offset < 0 || offset >= wf->length ||
126
                url_fseek(pb, ((int64_t)wf->sectors[offset >> wf->sector_bits] << WTV_SECTOR_BITS)
126
                avio_seek(pb, ((int64_t)wf->sectors[offset >> wf->sector_bits] << WTV_SECTOR_BITS)
127 127
                              + (offset & ((1 << wf->sector_bits) - 1)), SEEK_SET) < 0;
128 128
    wf->position = offset;
129 129
    return offset;
......
159 159
    WtvFile *wf;
160 160
    uint8_t *buffer;
161 161

  
162
    if (url_fseek(s->pb, first_sector << WTV_SECTOR_BITS, SEEK_SET) < 0)
162
    if (avio_seek(s->pb, first_sector << WTV_SECTOR_BITS, SEEK_SET) < 0)
163 163
        return NULL;
164 164

  
165 165
    wf = av_mallocz(sizeof(WtvFile));
......
195 195
        }
196 196
        wf->nb_sectors = 0;
197 197
        for (i = 0; i < nb_sectors1; i++) {
198
            if (url_fseek(s->pb, (int64_t)sectors1[i] << WTV_SECTOR_BITS, SEEK_SET) < 0)
198
            if (avio_seek(s->pb, (int64_t)sectors1[i] << WTV_SECTOR_BITS, SEEK_SET) < 0)
199 199
                break;
200 200
            wf->nb_sectors += read_ints(s->pb, wf->sectors + i * WTV_SECTOR_SIZE / 4, WTV_SECTOR_SIZE / 4);
201 201
        }
......
222 222

  
223 223
    /* seek to intial sector */
224 224
    wf->position = 0;
225
    if (url_fseek(s->pb, (int64_t)wf->sectors[0] << WTV_SECTOR_BITS, SEEK_SET) < 0) {
225
    if (avio_seek(s->pb, (int64_t)wf->sectors[0] << WTV_SECTOR_BITS, SEEK_SET) < 0) {
226 226
        av_free(wf->sectors);
227 227
        av_free(wf);
228 228
        return NULL;
......
492 492
    st->codec->extradata_size = filesize;
493 493
    avio_read(pb, st->codec->extradata, filesize);
494 494
done:
495
    url_fseek(pb, pos + length, SEEK_SET);
495
    avio_seek(pb, pos + length, SEEK_SET);
496 496
}
497 497

  
498 498
static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int type, int length)
......
665 665
        url_fskip(pb, size - 32);
666 666
        ff_get_guid(pb, &actual_subtype);
667 667
        ff_get_guid(pb, &actual_formattype);
668
        url_fseek(pb, -size, SEEK_CUR);
668
        avio_seek(pb, -size, SEEK_CUR);
669 669

  
670 670
        st = parse_media_type(s, st, sid, mediatype, actual_subtype, actual_formattype, size - 32);
671 671
        url_fskip(pb, 32);
......
963 963
    url_fskip(s->pb, 4);
964 964
    root_sector = avio_rl32(s->pb);
965 965

  
966
    url_fseek(s->pb, root_sector << WTV_SECTOR_BITS, SEEK_SET);
966
    avio_seek(s->pb, root_sector << WTV_SECTOR_BITS, SEEK_SET);
967 967
    root_size = avio_read(s->pb, root, root_size);
968 968
    if (root_size < 0)
969 969
        return AVERROR_INVALIDDATA;
......
978 978
    ret = parse_chunks(s, SEEK_TO_DATA, 0, 0);
979 979
    if (ret < 0)
980 980
        return ret;
981
    url_fseek(wtv->pb, -32, SEEK_CUR);
981
    avio_seek(wtv->pb, -32, SEEK_CUR);
982 982

  
983 983
    timeline_pos = url_ftell(s->pb); // save before opening another file
984 984

  
......
1028 1028
        }
1029 1029
    }
1030 1030

  
1031
    url_fseek(s->pb, timeline_pos, SEEK_SET);
1031
    avio_seek(s->pb, timeline_pos, SEEK_SET);
1032 1032
    return 0;
1033 1033
}
1034 1034

  
......
1072 1072
    i = ff_index_search_timestamp(wtv->index_entries, wtv->nb_index_entries, ts_relative, flags);
1073 1073
    if (i < 0) {
1074 1074
        if (wtv->last_valid_pts == AV_NOPTS_VALUE || ts < wtv->last_valid_pts)
1075
            url_fseek(pb, 0, SEEK_SET);
1075
            avio_seek(pb, 0, SEEK_SET);
1076 1076
        else if (st->duration != AV_NOPTS_VALUE && ts_relative > st->duration && wtv->nb_index_entries)
1077
            url_fseek(pb, wtv->index_entries[wtv->nb_index_entries - 1].pos, SEEK_SET);
1077
            avio_seek(pb, wtv->index_entries[wtv->nb_index_entries - 1].pos, SEEK_SET);
1078 1078
        if (parse_chunks(s, SEEK_TO_PTS, ts, 0) < 0)
1079 1079
            return AVERROR(ERANGE);
1080 1080
        return 0;
......
1083 1083
    if (wtv->epoch != AV_NOPTS_VALUE)
1084 1084
        wtv->pts += wtv->epoch;
1085 1085
    wtv->last_valid_pts = wtv->pts;
1086
    url_fseek(pb, wtv->index_entries[i].pos, SEEK_SET);
1086
    avio_seek(pb, wtv->index_entries[i].pos, SEEK_SET);
1087 1087
    return 0;
1088 1088
}
1089 1089

  

Also available in: Unified diff