Revision a2704c97 libavformat/mpc8.c

View differences:

libavformat/mpc8.c
120 120
static void mpc8_get_chunk_header(AVIOContext *pb, int *tag, int64_t *size)
121 121
{
122 122
    int64_t pos;
123
    pos = url_ftell(pb);
123
    pos = avio_tell(pb);
124 124
    *tag = avio_rl16(pb);
125 125
    *size = ff_get_v(pb);
126
    *size -= url_ftell(pb) - pos;
126
    *size -= avio_tell(pb) - pos;
127 127
}
128 128

  
129 129
static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
......
176 176

  
177 177
    switch(tag){
178 178
    case TAG_SEEKTBLOFF:
179
        pos = url_ftell(pb) + size;
179
        pos = avio_tell(pb) + size;
180 180
        off = ff_get_v(pb);
181 181
        mpc8_parse_seektable(s, chunk_pos + off);
182 182
        avio_seek(pb, pos, SEEK_SET);
......
194 194
    int tag = 0;
195 195
    int64_t size, pos;
196 196

  
197
    c->header_pos = url_ftell(pb);
197
    c->header_pos = avio_tell(pb);
198 198
    if(avio_rl32(pb) != TAG_MPCK){
199 199
        av_log(s, AV_LOG_ERROR, "Not a Musepack8 file\n");
200 200
        return -1;
201 201
    }
202 202

  
203 203
    while(!url_feof(pb)){
204
        pos = url_ftell(pb);
204
        pos = avio_tell(pb);
205 205
        mpc8_get_chunk_header(pb, &tag, &size);
206 206
        if(tag == TAG_STREAMHDR)
207 207
            break;
......
211 211
        av_log(s, AV_LOG_ERROR, "Stream header not found\n");
212 212
        return -1;
213 213
    }
214
    pos = url_ftell(pb);
214
    pos = avio_tell(pb);
215 215
    avio_seek(pb, 4, SEEK_CUR); //CRC
216 216
    c->ver = avio_r8(pb);
217 217
    if(c->ver != 8){
......
236 236
    st->codec->sample_rate = mpc8_rate[st->codec->extradata[0] >> 5];
237 237
    av_set_pts_info(st, 32, 1152  << (st->codec->extradata[1]&3)*2, st->codec->sample_rate);
238 238
    st->duration = c->samples / (1152 << (st->codec->extradata[1]&3)*2);
239
    size -= url_ftell(pb) - pos;
239
    size -= avio_tell(pb) - pos;
240 240

  
241 241
    return 0;
242 242
}
......
248 248
    int64_t pos, size;
249 249

  
250 250
    while(!url_feof(s->pb)){
251
        pos = url_ftell(s->pb);
251
        pos = avio_tell(s->pb);
252 252
        mpc8_get_chunk_header(s->pb, &tag, &size);
253 253
        if (size < 0)
254 254
            return -1;

Also available in: Unified diff