Revision f59d8ff8

View differences:

libavformat/4xm.c
106 106
    fourxm->fps = 1.0;
107 107

  
108 108
    /* skip the first 3 32-bit numbers */
109
    url_fseek(pb, 12, SEEK_CUR);
109
    avio_seek(pb, 12, SEEK_CUR);
110 110

  
111 111
    /* check for LIST-HEAD */
112 112
    GET_LIST_HEADER();
......
322 322
                fourxm->tracks[track_number].audio_pts += audio_frame_count;
323 323

  
324 324
            } else {
325
                url_fseek(pb, size, SEEK_CUR);
325
                avio_seek(pb, size, SEEK_CUR);
326 326
            }
327 327
            break;
328 328

  
329 329
        default:
330
            url_fseek(pb, size, SEEK_CUR);
330
            avio_seek(pb, size, SEEK_CUR);
331 331
            break;
332 332
        }
333 333
    }
libavformat/aiffdec.c
152 152

  
153 153
    /* Chunk is over */
154 154
    if (size)
155
        url_fseek(pb, size, SEEK_CUR);
155
        avio_seek(pb, size, SEEK_CUR);
156 156

  
157 157
    return num_frames;
158 158
}
......
276 276
        st->nb_frames * st->codec->frame_size : st->nb_frames;
277 277

  
278 278
    /* Position the stream at the first block */
279
    url_fseek(pb, offset, SEEK_SET);
279
    avio_seek(pb, offset, SEEK_SET);
280 280

  
281 281
    return 0;
282 282
}
libavformat/aiffenc.c
126 126

  
127 127
    if (!url_is_streamed(s->pb)) {
128 128
        /* File length */
129
        url_fseek(pb, aiff->form, SEEK_SET);
129
        avio_seek(pb, aiff->form, SEEK_SET);
130 130
        avio_wb32(pb, file_size - aiff->form - 4);
131 131

  
132 132
        /* Number of sample frames */
133
        url_fseek(pb, aiff->frames, SEEK_SET);
133
        avio_seek(pb, aiff->frames, SEEK_SET);
134 134
        avio_wb32(pb, (file_size-aiff->ssnd-12)/enc->block_align);
135 135

  
136 136
        /* Sound Data chunk size */
137
        url_fseek(pb, aiff->ssnd, SEEK_SET);
137
        avio_seek(pb, aiff->ssnd, SEEK_SET);
138 138
        avio_wb32(pb, file_size - aiff->ssnd - 4);
139 139

  
140 140
        /* return to the end */
141
        url_fseek(pb, end_size, SEEK_SET);
141
        avio_seek(pb, end_size, SEEK_SET);
142 142

  
143 143
        put_flush_packet(pb);
144 144
    }
libavformat/anm.c
143 143
        goto close_and_return;
144 144

  
145 145
    /* read page table */
146
    ret = url_fseek(pb, anm->page_table_offset, SEEK_SET);
146
    ret = avio_seek(pb, anm->page_table_offset, SEEK_SET);
147 147
    if (ret < 0)
148 148
        goto close_and_return;
149 149

  
......
192 192

  
193 193
    /* parse page header */
194 194
    if (anm->record < 0) {
195
        url_fseek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16), SEEK_SET);
195
        avio_seek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16), SEEK_SET);
196 196
        url_fskip(pb, 8 + 2*p->nb_records);
197 197
        anm->record = 0;
198 198
    }
......
209 209

  
210 210
    /* fetch record size */
211 211
    tmp = url_ftell(pb);
212
    url_fseek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16) +
212
    avio_seek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16) +
213 213
              8 + anm->record * 2, SEEK_SET);
214 214
    record_size = avio_rl16(pb);
215
    url_fseek(pb, tmp, SEEK_SET);
215
    avio_seek(pb, tmp, SEEK_SET);
216 216

  
217 217
    /* fetch record */
218 218
    pkt->size = av_get_packet(s->pb, pkt, record_size);
libavformat/ape.c
187 187
        /* Skip any unknown bytes at the end of the descriptor.
188 188
           This is for future compatibility */
189 189
        if (ape->descriptorlength > 52)
190
            url_fseek(pb, ape->descriptorlength - 52, SEEK_CUR);
190
            avio_seek(pb, ape->descriptorlength - 52, SEEK_CUR);
191 191

  
192 192
        /* Read header data */
193 193
        ape->compressiontype      = avio_rl16(pb);
......
212 212
        ape->finalframeblocks     = avio_rl32(pb);
213 213

  
214 214
        if (ape->formatflags & MAC_FORMAT_FLAG_HAS_PEAK_LEVEL) {
215
            url_fseek(pb, 4, SEEK_CUR); /* Skip the peak level */
215
            avio_seek(pb, 4, SEEK_CUR); /* Skip the peak level */
216 216
            ape->headerlength += 4;
217 217
        }
218 218

  
......
289 289
    /* try to read APE tags */
290 290
    if (!url_is_streamed(pb)) {
291 291
        ff_ape_parse_tag(s);
292
        url_fseek(pb, 0, SEEK_SET);
292
        avio_seek(pb, 0, SEEK_SET);
293 293
    }
294 294

  
295 295
    av_log(s, AV_LOG_DEBUG, "Decoding file - v%d.%02d, compression level %d\n", ape->fileversion / 1000, (ape->fileversion % 1000) / 10, ape->compressiontype);
......
342 342
    if (ape->currentframe > ape->totalframes)
343 343
        return AVERROR(EIO);
344 344

  
345
    url_fseek (s->pb, ape->frames[ape->currentframe].pos, SEEK_SET);
345
    avio_seek (s->pb, ape->frames[ape->currentframe].pos, SEEK_SET);
346 346

  
347 347
    /* Calculate how many blocks there are in this frame */
348 348
    if (ape->currentframe == (ape->totalframes - 1))
libavformat/apetag.c
74 74
    if (file_size < APE_TAG_FOOTER_BYTES)
75 75
        return;
76 76

  
77
    url_fseek(pb, file_size - APE_TAG_FOOTER_BYTES, SEEK_SET);
77
    avio_seek(pb, file_size - APE_TAG_FOOTER_BYTES, SEEK_SET);
78 78

  
79 79
    avio_read(pb, buf, 8);     /* APETAGEX */
80 80
    if (strncmp(buf, "APETAGEX", 8)) {
......
105 105
        return;
106 106
    }
107 107

  
108
    url_fseek(pb, file_size - tag_bytes, SEEK_SET);
108
    avio_seek(pb, file_size - tag_bytes, SEEK_SET);
109 109

  
110 110
    for (i=0; i<fields; i++)
111 111
        if (ape_tag_read_field(s) < 0) break;
libavformat/asfdec.c
181 181
    av_metadata_set2(&s->metadata, key, value, 0);
182 182
finish:
183 183
    av_freep(&value);
184
    url_fseek(s->pb, off + len, SEEK_SET);
184
    avio_seek(s->pb, off + len, SEEK_SET);
185 185
}
186 186

  
187 187
static int asf_read_file_properties(AVFormatContext *s, int64_t size)
......
427 427
    for (i=0; i<stream_ct; i++){
428 428
        avio_rl16(pb);
429 429
        ext_len = avio_rl16(pb);
430
        url_fseek(pb, ext_len, SEEK_CUR);
430
        avio_seek(pb, ext_len, SEEK_CUR);
431 431
    }
432 432

  
433 433
    for (i=0; i<payload_ext_ct; i++){
434 434
        ff_get_guid(pb, &g);
435 435
        ext_d=avio_rl16(pb);
436 436
        ext_len=avio_rl32(pb);
437
        url_fseek(pb, ext_len, SEEK_CUR);
437
        avio_seek(pb, ext_len, SEEK_CUR);
438 438
    }
439 439

  
440 440
    return 0;
......
653 653
        }
654 654
        if(url_ftell(pb) != gpos + gsize)
655 655
            av_log(s, AV_LOG_DEBUG, "gpos mismatch our pos=%"PRIu64", end=%"PRIu64"\n", url_ftell(pb)-gpos, gsize);
656
        url_fseek(pb, gpos + gsize, SEEK_SET);
656
        avio_seek(pb, gpos + gsize, SEEK_SET);
657 657
    }
658 658
    ff_get_guid(pb, &g);
659 659
    avio_rl64(pb);
......
757 757
        d= avio_r8(pb);
758 758
        rsize+=3;
759 759
    }else{
760
        url_fseek(pb, -1, SEEK_CUR); //FIXME
760
        avio_seek(pb, -1, SEEK_CUR); //FIXME
761 761
    }
762 762

  
763 763
    asf->packet_flags    = c;
......
1145 1145
    if (s->packet_size > 0)
1146 1146
        pos= (pos+s->packet_size-1-s->data_offset)/s->packet_size*s->packet_size+ s->data_offset;
1147 1147
    *ppos= pos;
1148
    url_fseek(s->pb, pos, SEEK_SET);
1148
    avio_seek(s->pb, pos, SEEK_SET);
1149 1149

  
1150 1150
//printf("asf_read_pts\n");
1151 1151
    asf_reset_header(s);
......
1187 1187
    int64_t current_pos= url_ftell(s->pb);
1188 1188
    int i;
1189 1189

  
1190
    url_fseek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET);
1190
    avio_seek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET);
1191 1191
    ff_get_guid(s->pb, &g);
1192 1192

  
1193 1193
    /* the data object can be followed by other top-level objects,
......
1195 1195
    while (ff_guidcmp(&g, &index_guid)) {
1196 1196
        int64_t gsize= avio_rl64(s->pb);
1197 1197
        if (gsize < 24 || url_feof(s->pb)) {
1198
            url_fseek(s->pb, current_pos, SEEK_SET);
1198
            avio_seek(s->pb, current_pos, SEEK_SET);
1199 1199
            return;
1200 1200
        }
1201
        url_fseek(s->pb, gsize-24, SEEK_CUR);
1201
        avio_seek(s->pb, gsize-24, SEEK_CUR);
1202 1202
        ff_get_guid(s->pb, &g);
1203 1203
    }
1204 1204

  
......
1226 1226
        }
1227 1227
        asf->index_read= 1;
1228 1228
    }
1229
    url_fseek(s->pb, current_pos, SEEK_SET);
1229
    avio_seek(s->pb, current_pos, SEEK_SET);
1230 1230
}
1231 1231

  
1232 1232
static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags)
......
1264 1264

  
1265 1265
    // various attempts to find key frame have failed so far
1266 1266
    //    asf_reset_header(s);
1267
    //    url_fseek(s->pb, pos, SEEK_SET);
1267
    //    avio_seek(s->pb, pos, SEEK_SET);
1268 1268
    //    key_pos = pos;
1269 1269
    //     for(i=0;i<16;i++){
1270 1270
    //         pos = url_ftell(s->pb);
......
1285 1285

  
1286 1286
        /* do the seek */
1287 1287
        av_log(s, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos);
1288
        url_fseek(s->pb, pos, SEEK_SET);
1288
        avio_seek(s->pb, pos, SEEK_SET);
1289 1289
    }
1290 1290
    asf_reset_header(s);
1291 1291
    return 0;
libavformat/asfenc.c
260 260
    int64_t pos1;
261 261

  
262 262
    pos1 = url_ftell(pb);
263
    url_fseek(pb, pos + 16, SEEK_SET);
263
    avio_seek(pb, pos + 16, SEEK_SET);
264 264
    avio_wl64(pb, pos1 - pos);
265
    url_fseek(pb, pos1, SEEK_SET);
265
    avio_seek(pb, pos1, SEEK_SET);
266 266
}
267 267

  
268 268
/* write an asf chunk (only used in streaming case) */
......
443 443
                return -1;
444 444
            if (wavsize != extra_size) {
445 445
                cur_pos = url_ftell(pb);
446
                url_fseek(pb, es_pos, SEEK_SET);
446
                avio_seek(pb, es_pos, SEEK_SET);
447 447
                avio_wl32(pb, wavsize); /* wav header len */
448
                url_fseek(pb, cur_pos, SEEK_SET);
448
                avio_seek(pb, cur_pos, SEEK_SET);
449 449
            }
450 450
            /* ERROR Correction */
451 451
            avio_w8(pb, 0x01);
......
530 530
    if (asf->is_streamed) {
531 531
        header_size += 8 + 30 + 50;
532 532

  
533
        url_fseek(pb, header_offset - 10 - 30, SEEK_SET);
533
        avio_seek(pb, header_offset - 10 - 30, SEEK_SET);
534 534
        avio_wl16(pb, header_size);
535
        url_fseek(pb, header_offset - 2 - 30, SEEK_SET);
535
        avio_seek(pb, header_offset - 2 - 30, SEEK_SET);
536 536
        avio_wl16(pb, header_size);
537 537

  
538 538
        header_size -= 8 + 30 + 50;
539 539
    }
540 540
    header_size += 24 + 6;
541
    url_fseek(pb, header_offset - 14, SEEK_SET);
541
    avio_seek(pb, header_offset - 14, SEEK_SET);
542 542
    avio_wl64(pb, header_size);
543
    url_fseek(pb, cur_pos, SEEK_SET);
543
    avio_seek(pb, cur_pos, SEEK_SET);
544 544

  
545 545
    /* movie chunk, followed by packets of packet_size */
546 546
    asf->data_offset = cur_pos;
......
871 871
    } else {
872 872
        /* rewrite an updated header */
873 873
        file_size = url_ftell(s->pb);
874
        url_fseek(s->pb, 0, SEEK_SET);
874
        avio_seek(s->pb, 0, SEEK_SET);
875 875
        asf_write_header1(s, file_size, data_size - asf->data_offset);
876 876
    }
877 877

  
libavformat/au.c
95 95

  
96 96
        /* update file size */
97 97
        file_size = url_ftell(pb);
98
        url_fseek(pb, 8, SEEK_SET);
98
        avio_seek(pb, 8, SEEK_SET);
99 99
        avio_wb32(pb, (uint32_t)(file_size - 24));
100
        url_fseek(pb, file_size, SEEK_SET);
100
        avio_seek(pb, file_size, SEEK_SET);
101 101

  
102 102
        put_flush_packet(pb);
103 103
    }
......
147 147

  
148 148
    if (size >= 24) {
149 149
        /* skip unused data */
150
        url_fseek(pb, size - 24, SEEK_CUR);
150
        avio_seek(pb, size - 24, SEEK_CUR);
151 151
    }
152 152

  
153 153
    /* now we are ready: build format streams */
libavformat/avidec.c
205 205
                return -1;
206 206
            }
207 207

  
208
            url_fseek(pb, offset+8, SEEK_SET);
208
            avio_seek(pb, offset+8, SEEK_SET);
209 209
            avi->odml_depth++;
210 210
            read_braindead_odml_indx(s, frame_num);
211 211
            avi->odml_depth--;
212 212
            frame_num += duration;
213 213

  
214
            url_fseek(pb, pos, SEEK_SET);
214
            avio_seek(pb, pos, SEEK_SET);
215 215
        }
216 216
    }
217 217
    avi->index_loaded=1;
......
668 668
            if(!url_is_streamed(pb) && !(s->flags & AVFMT_FLAG_IGNIDX)){
669 669
                read_braindead_odml_indx(s, 0);
670 670
            }
671
            url_fseek(pb, i+size, SEEK_SET);
671
            avio_seek(pb, i+size, SEEK_SET);
672 672
            break;
673 673
        case MKTAG('v', 'p', 'r', 'p'):
674 674
            if(stream_index < (unsigned)s->nb_streams && size > 9*4){
......
693 693
                }
694 694
                size -= 9*4;
695 695
            }
696
            url_fseek(pb, size, SEEK_CUR);
696
            avio_seek(pb, size, SEEK_CUR);
697 697
            break;
698 698
        case MKTAG('s', 't', 'r', 'n'):
699 699
            if(s->nb_streams){
......
892 892
        if(i>=0){
893 893
            int64_t pos= best_st->index_entries[i].pos;
894 894
            pos += best_ast->packet_size - best_ast->remaining;
895
            url_fseek(s->pb, pos + 8, SEEK_SET);
895
            avio_seek(s->pb, pos + 8, SEEK_SET);
896 896
//        av_log(s, AV_LOG_DEBUG, "pos=%"PRId64"\n", pos);
897 897

  
898 898
            assert(best_ast->remaining <= best_ast->packet_size);
......
1174 1174

  
1175 1175
        if(n >= 2){
1176 1176
            int64_t pos= st->index_entries[0].pos;
1177
            url_fseek(s->pb, pos + 4, SEEK_SET);
1177
            avio_seek(s->pb, pos + 4, SEEK_SET);
1178 1178
            size= avio_rl32(s->pb);
1179 1179
            if(pos + size > st->index_entries[1].pos)
1180 1180
                last_start= INT64_MAX;
......
1185 1185
        if(st->index_entries[n-1].pos < first_end)
1186 1186
            first_end= st->index_entries[n-1].pos;
1187 1187
    }
1188
    url_fseek(s->pb, oldpos, SEEK_SET);
1188
    avio_seek(s->pb, oldpos, SEEK_SET);
1189 1189
    return last_start > first_end;
1190 1190
}
1191 1191

  
......
1197 1197
    int64_t pos= url_ftell(pb);
1198 1198
    int ret = -1;
1199 1199

  
1200
    if (url_fseek(pb, avi->movi_end, SEEK_SET) < 0)
1200
    if (avio_seek(pb, avi->movi_end, SEEK_SET) < 0)
1201 1201
        goto the_end; // maybe truncated file
1202 1202
#ifdef DEBUG_SEEK
1203 1203
    printf("movi_end=0x%"PRIx64"\n", avi->movi_end);
......
1225 1225
        default:
1226 1226
        skip:
1227 1227
            size += (size & 1);
1228
            if (url_fseek(pb, size, SEEK_CUR) < 0)
1228
            if (avio_seek(pb, size, SEEK_CUR) < 0)
1229 1229
                goto the_end; // something is wrong here
1230 1230
            break;
1231 1231
        }
1232 1232
    }
1233 1233
 the_end:
1234
    url_fseek(pb, pos, SEEK_SET);
1234
    avio_seek(pb, pos, SEEK_SET);
1235 1235
    return ret;
1236 1236
}
1237 1237

  
......
1282 1282
        /* DV demux so it can synthesize correct timestamps.        */
1283 1283
        dv_offset_reset(avi->dv_demux, timestamp);
1284 1284

  
1285
        url_fseek(s->pb, pos, SEEK_SET);
1285
        avio_seek(s->pb, pos, SEEK_SET);
1286 1286
        avi->stream_index= -1;
1287 1287
        return 0;
1288 1288
    }
......
1324 1324
    }
1325 1325

  
1326 1326
    /* do the seek */
1327
    url_fseek(s->pb, pos, SEEK_SET);
1327
    avio_seek(s->pb, pos, SEEK_SET);
1328 1328
    avi->stream_index= -1;
1329 1329
    return 0;
1330 1330
}
libavformat/avienc.c
130 130

  
131 131
        assert(avist->frames_hdr_strm);
132 132
        stream = s->streams[n]->codec;
133
        url_fseek(pb, avist->frames_hdr_strm, SEEK_SET);
133
        avio_seek(pb, avist->frames_hdr_strm, SEEK_SET);
134 134
        ff_parse_specific_params(stream, &au_byterate, &au_ssize, &au_scale);
135 135
        if(au_ssize == 0) {
136 136
            avio_wl32(pb, avist->packet_count);
......
142 142
    }
143 143
    if(riff_id == 1) {
144 144
        assert(avi->frames_hdr_all);
145
        url_fseek(pb, avi->frames_hdr_all, SEEK_SET);
145
        avio_seek(pb, avi->frames_hdr_all, SEEK_SET);
146 146
        avio_wl32(pb, nb_frames);
147 147
    }
148
    url_fseek(pb, file_size, SEEK_SET);
148
    avio_seek(pb, file_size, SEEK_SET);
149 149

  
150 150
    return 0;
151 151
}
......
442 442
         pos = url_ftell(pb);
443 443

  
444 444
         /* Updating one entry in the AVI OpenDML master index */
445
         url_fseek(pb, avist->indexes.indx_start - 8, SEEK_SET);
445
         avio_seek(pb, avist->indexes.indx_start - 8, SEEK_SET);
446 446
         ffio_wfourcc(pb, "indx");            /* enabling this entry */
447 447
         url_fskip(pb, 8);
448 448
         avio_wl32(pb, avi->riff_id);         /* nEntriesInUse */
......
451 451
         avio_wl32(pb, pos - ix);             /* dwSize */
452 452
         avio_wl32(pb, avist->indexes.entry); /* dwDuration */
453 453

  
454
         url_fseek(pb, pos, SEEK_SET);
454
         avio_seek(pb, pos, SEEK_SET);
455 455
    }
456 456
    return 0;
457 457
}
......
601 601
            ff_end_tag(pb, avi->riff_start);
602 602

  
603 603
            file_size = url_ftell(pb);
604
            url_fseek(pb, avi->odml_list - 8, SEEK_SET);
604
            avio_seek(pb, avi->odml_list - 8, SEEK_SET);
605 605
            ffio_wfourcc(pb, "LIST"); /* Making this AVI OpenDML one */
606 606
            url_fskip(pb, 16);
607 607

  
......
619 619
                }
620 620
            }
621 621
            avio_wl32(pb, nb_frames);
622
            url_fseek(pb, file_size, SEEK_SET);
622
            avio_seek(pb, file_size, SEEK_SET);
623 623

  
624 624
            avi_write_counters(s, avi->riff_id);
625 625
        }
libavformat/avio.h
420 420
 */
421 421
attribute_deprecated int url_fopen( AVIOContext **s, const char *url, int flags);
422 422
attribute_deprecated int url_fclose(AVIOContext *s);
423
attribute_deprecated int64_t url_fseek(AVIOContext *s, int64_t offset, int whence);
423 424
/**
424 425
 * @}
425 426
 */
......
465 466
 * fseek() equivalent for AVIOContext.
466 467
 * @return new position or AVERROR.
467 468
 */
468
int64_t url_fseek(AVIOContext *s, int64_t offset, int whence);
469
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
469 470

  
470 471
/**
471 472
 * Skip given number of bytes forward.
libavformat/aviobuf.c
176 176
    s->must_flush = 0;
177 177
}
178 178

  
179
int64_t url_fseek(AVIOContext *s, int64_t offset, int whence)
179
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
180 180
{
181 181
    int64_t offset1;
182 182
    int64_t pos;
......
235 235

  
236 236
int url_fskip(AVIOContext *s, int64_t offset)
237 237
{
238
    int64_t ret = url_fseek(s, offset, SEEK_CUR);
238
    int64_t ret = avio_seek(s, offset, SEEK_CUR);
239 239
    return ret < 0 ? ret : 0;
240 240
}
241 241

  
242 242
int64_t url_ftell(AVIOContext *s)
243 243
{
244
    return url_fseek(s, 0, SEEK_CUR);
244
    return avio_seek(s, 0, SEEK_CUR);
245 245
}
246 246

  
247 247
int64_t url_fsize(AVIOContext *s)
......
365 365
{
366 366
    return avio_close(s);
367 367
}
368
int64_t url_fseek(AVIOContext *s, int64_t offset, int whence)
369
{
370
    return avio_seek(s, offset, whence);
371
}
368 372
#endif
369 373

  
370 374
int avio_put_str(AVIOContext *s, const char *str)
libavformat/bethsoftvid.c
67 67
    *    bytes: 'V' 'I' 'D'
68 68
    *    int16s: always_512, nframes, width, height, delay, always_14
69 69
    */
70
    url_fseek(pb, 5, SEEK_CUR);
70
    avio_seek(pb, 5, SEEK_CUR);
71 71
    vid->nframes = avio_rl16(pb);
72 72

  
73 73
    stream = av_new_stream(s, 0);
......
146 146
        if(bytes_copied == npixels){ // sometimes no stop character is given, need to keep track of bytes copied
147 147
            // may contain a 0 byte even if read all pixels
148 148
            if(avio_r8(pb))
149
                url_fseek(pb, -1, SEEK_CUR);
149
                avio_seek(pb, -1, SEEK_CUR);
150 150
            break;
151 151
        }
152 152
        if(bytes_copied > npixels)
......
185 185
    block_type = avio_r8(pb);
186 186
    switch(block_type){
187 187
        case PALETTE_BLOCK:
188
            url_fseek(pb, -1, SEEK_CUR);     // include block type
188
            avio_seek(pb, -1, SEEK_CUR);     // include block type
189 189
            ret_value = av_get_packet(pb, pkt, 3 * 256 + 1);
190 190
            if(ret_value != 3 * 256 + 1){
191 191
                av_free_packet(pkt);
libavformat/bfi.c
98 98
    astream->codec->bits_per_coded_sample = 8;
99 99
    astream->codec->bit_rate        =
100 100
        astream->codec->sample_rate * astream->codec->bits_per_coded_sample;
101
    url_fseek(pb, chunk_header - 3, SEEK_SET);
101
    avio_seek(pb, chunk_header - 3, SEEK_SET);
102 102
    av_set_pts_info(astream, 64, 1, astream->codec->sample_rate);
103 103
    return 0;
104 104
}
libavformat/bink.c
225 225
                    AV_RL32(pkt->data) / (2 * s->streams[bink->current_track]->codec->channels);
226 226
            return 0;
227 227
        } else {
228
            url_fseek(pb, audio_size, SEEK_CUR);
228
            avio_seek(pb, audio_size, SEEK_CUR);
229 229
        }
230 230
    }
231 231

  
......
251 251
        return -1;
252 252

  
253 253
    /* seek to the first frame */
254
    url_fseek(s->pb, vst->index_entries[0].pos, SEEK_SET);
254
    avio_seek(s->pb, vst->index_entries[0].pos, SEEK_SET);
255 255
    bink->video_pts = 0;
256 256
    memset(bink->audio_pts, 0, sizeof(bink->audio_pts));
257 257
    bink->current_track = -1;
libavformat/c93.c
140 140
    }
141 141

  
142 142
    if (c93->current_frame == 0) {
143
        url_fseek(pb, br->index * 2048, SEEK_SET);
143
        avio_seek(pb, br->index * 2048, SEEK_SET);
144 144
        for (i = 0; i < 32; i++) {
145 145
            c93->frame_offsets[i] = avio_rl32(pb);
146 146
        }
147 147
    }
148 148

  
149
    url_fseek(pb,br->index * 2048 +
149
    avio_seek(pb,br->index * 2048 +
150 150
            c93->frame_offsets[c93->current_frame], SEEK_SET);
151 151
    datasize = avio_rl16(pb); /* video frame size */
152 152

  
libavformat/cafdec.c
292 292

  
293 293
    /* position the stream at the start of data */
294 294
    if (caf->data_size >= 0)
295
        url_fseek(pb, caf->data_start, SEEK_SET);
295
        avio_seek(pb, caf->data_start, SEEK_SET);
296 296

  
297 297
    return 0;
298 298
}
......
377 377
        return -1;
378 378
    }
379 379

  
380
    url_fseek(s->pb, pos + caf->data_start, SEEK_SET);
380
    avio_seek(s->pb, pos + caf->data_start, SEEK_SET);
381 381
    return 0;
382 382
}
383 383

  
libavformat/dv.c
419 419
        if (state == 0x003f0700 || state == 0xff3f0700)
420 420
            marker_pos = url_ftell(s->pb);
421 421
        if (state == 0xff3f0701 && url_ftell(s->pb) - marker_pos == 80) {
422
            url_fseek(s->pb, -163, SEEK_CUR);
422
            avio_seek(s->pb, -163, SEEK_CUR);
423 423
            state = avio_rb32(s->pb);
424 424
            break;
425 425
        }
......
428 428
    AV_WB32(c->buf, state);
429 429

  
430 430
    if (avio_read(s->pb, c->buf + 4, DV_PROFILE_BYTES - 4) <= 0 ||
431
        url_fseek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
431
        avio_seek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
432 432
        return AVERROR(EIO);
433 433

  
434 434
    c->dv_demux->sys = ff_dv_frame_profile(c->dv_demux->sys, c->buf, DV_PROFILE_BYTES);
......
473 473

  
474 474
    dv_offset_reset(c, offset / c->sys->frame_size);
475 475

  
476
    offset = url_fseek(s->pb, offset, SEEK_SET);
476
    offset = avio_seek(s->pb, offset, SEEK_SET);
477 477
    return (offset < 0) ? offset : 0;
478 478
}
479 479

  
libavformat/dxa.c
115 115
            c->bpc = ((c->bpc + ast->codec->block_align - 1) / ast->codec->block_align) * ast->codec->block_align;
116 116
        c->bytes_left = fsize;
117 117
        c->wavpos = url_ftell(pb);
118
        url_fseek(pb, c->vidpos, SEEK_SET);
118
        avio_seek(pb, c->vidpos, SEEK_SET);
119 119
    }
120 120

  
121 121
    /* now we are ready: build format streams */
......
151 151

  
152 152
    if(!c->readvid && c->has_sound && c->bytes_left){
153 153
        c->readvid = 1;
154
        url_fseek(s->pb, c->wavpos, SEEK_SET);
154
        avio_seek(s->pb, c->wavpos, SEEK_SET);
155 155
        size = FFMIN(c->bytes_left, c->bpc);
156 156
        ret = av_get_packet(s->pb, pkt, size);
157 157
        pkt->stream_index = 1;
......
161 161
        c->wavpos = url_ftell(s->pb);
162 162
        return 0;
163 163
    }
164
    url_fseek(s->pb, c->vidpos, SEEK_SET);
164
    avio_seek(s->pb, c->vidpos, SEEK_SET);
165 165
    while(!url_feof(s->pb) && c->frames){
166 166
        avio_read(s->pb, buf, 4);
167 167
        switch(AV_RL32(buf)){
libavformat/electronicarts.c
369 369
            return err;
370 370
        }
371 371

  
372
        url_fseek(pb, startpos + size, SEEK_SET);
372
        avio_seek(pb, startpos + size, SEEK_SET);
373 373
    }
374 374

  
375
    url_fseek(pb, 0, SEEK_SET);
375
    avio_seek(pb, 0, SEEK_SET);
376 376

  
377 377
    return 1;
378 378
}
......
536 536
        case fVGT_TAG:
537 537
        case MADm_TAG:
538 538
        case MADe_TAG:
539
            url_fseek(pb, -8, SEEK_CUR);     // include chunk preamble
539
            avio_seek(pb, -8, SEEK_CUR);     // include chunk preamble
540 540
            chunk_size += 8;
541 541
            goto get_video_packet;
542 542

  
543 543
        case mTCD_TAG:
544
            url_fseek(pb, 8, SEEK_CUR);  // skip ea dct header
544
            avio_seek(pb, 8, SEEK_CUR);  // skip ea dct header
545 545
            chunk_size -= 8;
546 546
            goto get_video_packet;
547 547

  
......
560 560
            break;
561 561

  
562 562
        default:
563
            url_fseek(pb, chunk_size, SEEK_CUR);
563
            avio_seek(pb, chunk_size, SEEK_CUR);
564 564
            break;
565 565
        }
566 566
    }
libavformat/ffmdec.c
118 118
            len = size;
119 119
        if (len == 0) {
120 120
            if (url_ftell(pb) == ffm->file_size)
121
                url_fseek(pb, ffm->packet_size, SEEK_SET);
121
                avio_seek(pb, ffm->packet_size, SEEK_SET);
122 122
    retry_read:
123 123
            id = avio_rb16(pb); /* PACKET_ID */
124 124
            if (id != PACKET_ID)
......
137 137
                if (!frame_offset) {
138 138
                    /* This packet has no frame headers in it */
139 139
                    if (url_ftell(pb) >= ffm->packet_size * 3) {
140
                        url_fseek(pb, -ffm->packet_size * 2, SEEK_CUR);
140
                        avio_seek(pb, -ffm->packet_size * 2, SEEK_CUR);
141 141
                        goto retry_read;
142 142
                    }
143 143
                    /* This is bad, we cannot find a valid frame header */
......
178 178
#ifdef DEBUG_SEEK
179 179
    av_log(s, AV_LOG_DEBUG, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos);
180 180
#endif
181
    url_fseek(pb, pos, SEEK_SET);
181
    avio_seek(pb, pos, SEEK_SET);
182 182
}
183 183

  
184 184
static int64_t get_dts(AVFormatContext *s, int64_t pos)
......
248 248
    //printf("pts range %0.6f - %0.6f\n", get_dts(s, 0) / 1000000. , get_dts(s, ffm->file_size - 2 * FFM_PACKET_SIZE) / 1000000. );
249 249

  
250 250
 end:
251
    url_fseek(pb, ptr, SEEK_SET);
251
    avio_seek(pb, ptr, SEEK_SET);
252 252
}
253 253

  
254 254

  
libavformat/filmstripdec.c
43 43
    if (url_is_streamed(s->pb))
44 44
        return AVERROR(EIO);
45 45

  
46
    url_fseek(pb, url_fsize(pb) - 36, SEEK_SET);
46
    avio_seek(pb, url_fsize(pb) - 36, SEEK_SET);
47 47
    if (avio_rb32(pb) != RAND_TAG) {
48 48
        av_log(s, AV_LOG_ERROR, "magic number not found");
49 49
        return AVERROR_INVALIDDATA;
......
69 69
    film->leading         = avio_rb16(pb);
70 70
    av_set_pts_info(st, 64, 1, avio_rb16(pb));
71 71

  
72
    url_fseek(pb, 0, SEEK_SET);
72
    avio_seek(pb, 0, SEEK_SET);
73 73

  
74 74
    return 0;
75 75
}
......
94 94
static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
95 95
{
96 96
    AVStream *st = s->streams[stream_index];
97
    url_fseek(s->pb, FFMAX(timestamp, 0) * st->codec->width * st->codec->height * 4, SEEK_SET);
97
    avio_seek(s->pb, FFMAX(timestamp, 0) * st->codec->width * st->codec->height * 4, SEEK_SET);
98 98
    return 0;
99 99
}
100 100

  
libavformat/flacdec.c
41 41

  
42 42
    /* if fLaC marker is not found, assume there is no header */
43 43
    if (avio_rl32(s->pb) != MKTAG('f','L','a','C')) {
44
        url_fseek(s->pb, -4, SEEK_CUR);
44
        avio_seek(s->pb, -4, SEEK_CUR);
45 45
        return 0;
46 46
    }
47 47

  
......
65 65
            break;
66 66
        /* skip metadata block for unsupported types */
67 67
        default:
68
            ret = url_fseek(s->pb, metadata_size, SEEK_CUR);
68
            ret = avio_seek(s->pb, metadata_size, SEEK_CUR);
69 69
            if (ret < 0)
70 70
                return ret;
71 71
        }
libavformat/flacenc.c
101 101
    if (!url_is_streamed(pb)) {
102 102
        /* rewrite the STREAMINFO header block data */
103 103
        file_size = url_ftell(pb);
104
        url_fseek(pb, 8, SEEK_SET);
104
        avio_seek(pb, 8, SEEK_SET);
105 105
        avio_write(pb, streaminfo, FLAC_STREAMINFO_SIZE);
106
        url_fseek(pb, file_size, SEEK_SET);
106
        avio_seek(pb, file_size, SEEK_SET);
107 107
        put_flush_packet(pb);
108 108
    } else {
109 109
        av_log(s, AV_LOG_WARNING, "unable to rewrite FLAC header.\n");
libavformat/flic.c
135 135
        return AVERROR(EIO);
136 136
    }
137 137

  
138
    url_fseek(pb, -FLIC_PREAMBLE_SIZE, SEEK_CUR);
138
    avio_seek(pb, -FLIC_PREAMBLE_SIZE, SEEK_CUR);
139 139

  
140 140
    /* Time to figure out the framerate:
141 141
     * If the first preamble's magic number is 0xAAAA then this file is from
......
173 173
        av_set_pts_info(st, 64, FLIC_MC_SPEED, 70);
174 174

  
175 175
        /* rewind the stream since the first chunk is at offset 12 */
176
        url_fseek(pb, 12, SEEK_SET);
176
        avio_seek(pb, 12, SEEK_SET);
177 177

  
178 178
        /* send over abbreviated FLIC header chunk */
179 179
        av_free(st->codec->extradata);
......
239 239
            }
240 240

  
241 241
            /* skip useless 10B sub-header (yes, it's not accounted for in the chunk header) */
242
            url_fseek(pb, 10, SEEK_CUR);
242
            avio_seek(pb, 10, SEEK_CUR);
243 243

  
244 244
            pkt->stream_index = flic->audio_stream_index;
245 245
            pkt->pos = url_ftell(pb);
......
253 253
            packet_read = 1;
254 254
        } else {
255 255
            /* not interested in this chunk */
256
            url_fseek(pb, size - 6, SEEK_CUR);
256
            avio_seek(pb, size - 6, SEEK_CUR);
257 257
        }
258 258
    }
259 259

  
libavformat/flvdec.c
277 277
    }
278 278

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

  
283 283
    s->start_time = 0;
......
337 337
        else /* skip packet */
338 338
            av_log(s, AV_LOG_DEBUG, "skipping flv packet: type %d, size %d, flags %d\n", type, size, flags);
339 339
    skip:
340
        url_fseek(s->pb, next, SEEK_SET);
340
        avio_seek(s->pb, next, SEEK_SET);
341 341
        continue;
342 342
    }
343 343

  
......
361 361
       ||(st->discard >= AVDISCARD_BIDIR  &&  ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_DISP_INTER && !is_audio))
362 362
       || st->discard >= AVDISCARD_ALL
363 363
       ){
364
        url_fseek(s->pb, next, SEEK_SET);
364
        avio_seek(s->pb, next, SEEK_SET);
365 365
        continue;
366 366
    }
367 367
    if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY)
......
374 374
        int size;
375 375
        const int64_t pos= url_ftell(s->pb);
376 376
        const int64_t fsize= url_fsize(s->pb);
377
        url_fseek(s->pb, fsize-4, SEEK_SET);
377
        avio_seek(s->pb, fsize-4, SEEK_SET);
378 378
        size= avio_rb32(s->pb);
379
        url_fseek(s->pb, fsize-3-size, SEEK_SET);
379
        avio_seek(s->pb, fsize-3-size, SEEK_SET);
380 380
        if(size == avio_rb24(s->pb) + 11){
381 381
            uint32_t ts = avio_rb24(s->pb);
382 382
            ts |= avio_r8(s->pb) << 24;
383 383
            s->duration = ts * (int64_t)AV_TIME_BASE / 1000;
384 384
        }
385
        url_fseek(s->pb, pos, SEEK_SET);
385
        avio_seek(s->pb, pos, SEEK_SET);
386 386
    }
387 387

  
388 388
    if(is_audio){
libavformat/flvenc.c
289 289

  
290 290
    /* write total size of tag */
291 291
    data_size= url_ftell(pb) - metadata_size_pos - 10;
292
    url_fseek(pb, metadata_size_pos, SEEK_SET);
292
    avio_seek(pb, metadata_size_pos, SEEK_SET);
293 293
    avio_wb24(pb, data_size);
294
    url_fseek(pb, data_size + 10 - 3, SEEK_CUR);
294
    avio_seek(pb, data_size + 10 - 3, SEEK_CUR);
295 295
    avio_wb32(pb, data_size + 11);
296 296

  
297 297
    for (i = 0; i < s->nb_streams; i++) {
......
316 316
                ff_isom_write_avcc(pb, enc->extradata, enc->extradata_size);
317 317
            }
318 318
            data_size = url_ftell(pb) - pos;
319
            url_fseek(pb, -data_size - 10, SEEK_CUR);
319
            avio_seek(pb, -data_size - 10, SEEK_CUR);
320 320
            avio_wb24(pb, data_size);
321
            url_fseek(pb, data_size + 10 - 3, SEEK_CUR);
321
            avio_seek(pb, data_size + 10 - 3, SEEK_CUR);
322 322
            avio_wb32(pb, data_size + 11); // previous tag size
323 323
        }
324 324
    }
......
346 346
    file_size = url_ftell(pb);
347 347

  
348 348
    /* update informations */
349
    url_fseek(pb, flv->duration_offset, SEEK_SET);
349
    avio_seek(pb, flv->duration_offset, SEEK_SET);
350 350
    put_amf_double(pb, flv->duration / (double)1000);
351
    url_fseek(pb, flv->filesize_offset, SEEK_SET);
351
    avio_seek(pb, flv->filesize_offset, SEEK_SET);
352 352
    put_amf_double(pb, file_size);
353 353

  
354
    url_fseek(pb, file_size, SEEK_SET);
354
    avio_seek(pb, file_size, SEEK_SET);
355 355
    return 0;
356 356
}
357 357

  
libavformat/gxf.c
397 397
    if (tmp != 1)
398 398
        goto start;
399 399
    last_pos = url_ftell(pb);
400
    if (url_fseek(pb, -5, SEEK_CUR) < 0)
400
    if (avio_seek(pb, -5, SEEK_CUR) < 0)
401 401
        goto out;
402 402
    if (!parse_packet_header(pb, &type, &len) || type != PKT_MEDIA) {
403
        if (url_fseek(pb, last_pos, SEEK_SET) < 0)
403
        if (avio_seek(pb, last_pos, SEEK_SET) < 0)
404 404
            goto out;
405 405
        goto start;
406 406
    }
......
409 409
    cur_timestamp = avio_rb32(pb);
410 410
    last_found_pos = url_ftell(pb) - 16 - 6;
411 411
    if ((track >= 0 && track != cur_track) || (timestamp >= 0 && timestamp > cur_timestamp)) {
412
        if (url_fseek(pb, last_pos, SEEK_SET) >= 0)
412
        if (avio_seek(pb, last_pos, SEEK_SET) >= 0)
413 413
            goto start;
414 414
    }
415 415
out:
416 416
    if (last_found_pos)
417
        url_fseek(pb, last_found_pos, SEEK_SET);
417
        avio_seek(pb, last_found_pos, SEEK_SET);
418 418
    return cur_timestamp;
419 419
}
420 420

  
......
495 495
    if (idx < st->nb_index_entries - 2)
496 496
        maxlen = st->index_entries[idx + 2].pos - pos;
497 497
    maxlen = FFMAX(maxlen, 200 * 1024);
498
    res = url_fseek(s->pb, pos, SEEK_SET);
498
    res = avio_seek(s->pb, pos, SEEK_SET);
499 499
    if (res < 0)
500 500
        return res;
501 501
    found = gxf_resync_media(s, maxlen, -1, timestamp);
......
508 508
                                  int64_t *pos, int64_t pos_limit) {
509 509
    AVIOContext *pb = s->pb;
510 510
    int64_t res;
511
    if (url_fseek(pb, *pos, SEEK_SET) < 0)
511
    if (avio_seek(pb, *pos, SEEK_SET) < 0)
512 512
        return AV_NOPTS_VALUE;
513 513
    res = gxf_resync_media(s, pos_limit - *pos, -1, -1);
514 514
    *pos = url_ftell(pb);
libavformat/gxfenc.c
131 131
        size = url_ftell(pb) - pos;
132 132
    }
133 133
    curpos = url_ftell(pb);
134
    url_fseek(pb, pos + 6, SEEK_SET);
134
    avio_seek(pb, pos + 6, SEEK_SET);
135 135
    avio_wb32(pb, size);
136
    url_fseek(pb, curpos, SEEK_SET);
136
    avio_seek(pb, curpos, SEEK_SET);
137 137
    return curpos - pos;
138 138
}
139 139

  
......
142 142
    int64_t curpos;
143 143

  
144 144
    curpos = url_ftell(pb);
145
    url_fseek(pb, pos, SEEK_SET);
145
    avio_seek(pb, pos, SEEK_SET);
146 146
    avio_wb16(pb, curpos - pos - 2);
147
    url_fseek(pb, curpos, SEEK_SET);
147
    avio_seek(pb, curpos, SEEK_SET);
148 148
    return curpos - pos;
149 149
}
150 150

  
......
581 581
        }
582 582

  
583 583
        curpos = url_ftell(pb);
584
        url_fseek(pb, startpos, SEEK_SET);
584
        avio_seek(pb, startpos, SEEK_SET);
585 585
        avio_wl16(pb, curpos - startpos);
586
        url_fseek(pb, curpos, SEEK_SET);
586
        avio_seek(pb, curpos, SEEK_SET);
587 587
    }
588 588
    return url_ftell(pb) - pos;
589 589
}
......
776 776

  
777 777
    gxf_write_eos_packet(pb);
778 778
    end = url_ftell(pb);
779
    url_fseek(pb, 0, SEEK_SET);
779
    avio_seek(pb, 0, SEEK_SET);
780 780
    /* overwrite map, flt and umf packets with new values */
781 781
    gxf_write_map_packet(s, 1);
782 782
    gxf_write_flt_packet(s);
......
784 784
    put_flush_packet(pb);
785 785
    /* update duration in all map packets */
786 786
    for (i = 1; i < gxf->map_offsets_nb; i++) {
787
        url_fseek(pb, gxf->map_offsets[i], SEEK_SET);
787
        avio_seek(pb, gxf->map_offsets[i], SEEK_SET);
788 788
        gxf_write_map_packet(s, 1);
789 789
        put_flush_packet(pb);
790 790
    }
791 791

  
792
    url_fseek(pb, end, SEEK_SET);
792
    avio_seek(pb, end, SEEK_SET);
793 793

  
794 794
    av_freep(&gxf->flt_entries);
795 795
    av_freep(&gxf->map_offsets);
libavformat/id3v1.c
232 232
        /* XXX: change that */
233 233
        filesize = url_fsize(s->pb);
234 234
        if (filesize > 128) {
235
            url_fseek(s->pb, filesize - 128, SEEK_SET);
235
            avio_seek(s->pb, filesize - 128, SEEK_SET);
236 236
            ret = avio_read(s->pb, buf, ID3v1_TAG_SIZE);
237 237
            if (ret == ID3v1_TAG_SIZE) {
238 238
                parse_tag(s, buf);
239 239
            }
240
            url_fseek(s->pb, 0, SEEK_SET);
240
            avio_seek(s->pb, 0, SEEK_SET);
241 241
        }
242 242
    }
243 243
}
libavformat/id3v2.c
230 230
            break;
231 231
        }
232 232
        /* Skip to end of tag */
233
        url_fseek(s->pb, next, SEEK_SET);
233
        avio_seek(s->pb, next, SEEK_SET);
234 234
    }
235 235

  
236 236
    if (len > 0) {
......
271 271
                   (buf[9] & 0x7f);
272 272
            ff_id3v2_parse(s, len, buf[3], buf[5]);
273 273
        } else {
274
            url_fseek(s->pb, off, SEEK_SET);
274
            avio_seek(s->pb, off, SEEK_SET);
275 275
        }
276 276
    } while (found_header);
277 277
    ff_metadata_conv(&s->metadata, NULL, ff_id3v2_34_metadata_conv);
libavformat/idcin.c
257 257

  
258 258
        chunk_size = avio_rl32(pb);
259 259
        /* skip the number of decoded bytes (always equal to width * height) */
260
        url_fseek(pb, 4, SEEK_CUR);
260
        avio_seek(pb, 4, SEEK_CUR);
261 261
        chunk_size -= 4;
262 262
        ret= av_get_packet(pb, pkt, chunk_size);
263 263
        if (ret < 0)
libavformat/idroqdec.c
136 136
                break;
137 137
            }
138 138
            /* don't care about this chunk anymore */
139
            url_fseek(pb, RoQ_CHUNK_PREAMBLE_SIZE, SEEK_CUR);
139
            avio_seek(pb, RoQ_CHUNK_PREAMBLE_SIZE, SEEK_CUR);
140 140
            break;
141 141

  
142 142
        case RoQ_QUAD_CODEBOOK:
143 143
            /* packet needs to contain both this codebook and next VQ chunk */
144 144
            codebook_offset = url_ftell(pb) - RoQ_CHUNK_PREAMBLE_SIZE;
145 145
            codebook_size = chunk_size;
146
            url_fseek(pb, codebook_size, SEEK_CUR);
146
            avio_seek(pb, codebook_size, SEEK_CUR);
147 147
            if (avio_read(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
148 148
                RoQ_CHUNK_PREAMBLE_SIZE)
149 149
                return AVERROR(EIO);
......
151 151
                codebook_size;
152 152

  
153 153
            /* rewind */
154
            url_fseek(pb, codebook_offset, SEEK_SET);
154
            avio_seek(pb, codebook_offset, SEEK_SET);
155 155

  
156 156
            /* load up the packet */
157 157
            ret= av_get_packet(pb, pkt, chunk_size);
libavformat/iff.c
226 226
        url_fskip(pb, data_size - (url_ftell(pb) - orig_pos) + (data_size & 1));
227 227
    }
228 228

  
229
    url_fseek(pb, iff->body_pos, SEEK_SET);
229
    avio_seek(pb, iff->body_pos, SEEK_SET);
230 230

  
231 231
    switch(st->codec->codec_type) {
232 232
    case AVMEDIA_TYPE_AUDIO:
libavformat/ipmovie.c
133 133
            s->audio_chunk_size -= 6;
134 134
        }
135 135

  
136
        url_fseek(pb, s->audio_chunk_offset, SEEK_SET);
136
        avio_seek(pb, s->audio_chunk_offset, SEEK_SET);
137 137
        s->audio_chunk_offset = 0;
138 138

  
139 139
        if (s->audio_chunk_size != av_get_packet(pb, pkt, s->audio_chunk_size))
......
163 163
            return CHUNK_NOMEM;
164 164

  
165 165
        pkt->pos= s->decode_map_chunk_offset;
166
        url_fseek(pb, s->decode_map_chunk_offset, SEEK_SET);
166
        avio_seek(pb, s->decode_map_chunk_offset, SEEK_SET);
167 167
        s->decode_map_chunk_offset = 0;
168 168

  
169 169
        if (avio_read(pb, pkt->data, s->decode_map_chunk_size) !=
......
172 172
            return CHUNK_EOF;
173 173
        }
174 174

  
175
        url_fseek(pb, s->video_chunk_offset, SEEK_SET);
175
        avio_seek(pb, s->video_chunk_offset, SEEK_SET);
176 176
        s->video_chunk_offset = 0;
177 177

  
178 178
        if (avio_read(pb, pkt->data + s->decode_map_chunk_size,
......
193 193

  
194 194
    } else {
195 195

  
196
        url_fseek(pb, s->next_chunk_offset, SEEK_SET);
196
        avio_seek(pb, s->next_chunk_offset, SEEK_SET);
197 197
        chunk_type = CHUNK_DONE;
198 198

  
199 199
    }
......
299 299

  
300 300
        case OPCODE_END_OF_STREAM:
301 301
            debug_ipmovie("end of stream\n");
302
            url_fseek(pb, opcode_size, SEEK_CUR);
302
            avio_seek(pb, opcode_size, SEEK_CUR);
303 303
            break;
304 304

  
305 305
        case OPCODE_END_OF_CHUNK:
306 306
            debug_ipmovie("end of chunk\n");
307
            url_fseek(pb, opcode_size, SEEK_CUR);
307
            avio_seek(pb, opcode_size, SEEK_CUR);
308 308
            break;
309 309

  
310 310
        case OPCODE_CREATE_TIMER:
......
359 359

  
360 360
        case OPCODE_START_STOP_AUDIO:
361 361
            debug_ipmovie("start/stop audio\n");
362
            url_fseek(pb, opcode_size, SEEK_CUR);
362
            avio_seek(pb, opcode_size, SEEK_CUR);
363 363
            break;
364 364

  
365 365
        case OPCODE_INIT_VIDEO_BUFFERS:
......
393 393
        case OPCODE_UNKNOWN_14:
394 394
        case OPCODE_UNKNOWN_15:
395 395
            debug_ipmovie("unknown (but documented) opcode %02X\n", opcode_type);
396
            url_fseek(pb, opcode_size, SEEK_CUR);
396
            avio_seek(pb, opcode_size, SEEK_CUR);
397 397
            break;
398 398

  
399 399
        case OPCODE_SEND_BUFFER:
400 400
            debug_ipmovie("send buffer\n");
401
            url_fseek(pb, opcode_size, SEEK_CUR);
401
            avio_seek(pb, opcode_size, SEEK_CUR);
402 402
            break;
403 403

  
404 404
        case OPCODE_AUDIO_FRAME:
......
407 407
            /* log position and move on for now */
408 408
            s->audio_chunk_offset = url_ftell(pb);
409 409
            s->audio_chunk_size = opcode_size;
410
            url_fseek(pb, opcode_size, SEEK_CUR);
410
            avio_seek(pb, opcode_size, SEEK_CUR);
411 411
            break;
412 412

  
413 413
        case OPCODE_SILENCE_FRAME:
414 414
            debug_ipmovie("silence frame\n");
415
            url_fseek(pb, opcode_size, SEEK_CUR);
415
            avio_seek(pb, opcode_size, SEEK_CUR);
416 416
            break;
417 417

  
418 418
        case OPCODE_INIT_VIDEO_MODE:
419 419
            debug_ipmovie("initialize video mode\n");
420
            url_fseek(pb, opcode_size, SEEK_CUR);
420
            avio_seek(pb, opcode_size, SEEK_CUR);
421 421
            break;
422 422

  
423 423
        case OPCODE_CREATE_GRADIENT:
424 424
            debug_ipmovie("create gradient\n");
425
            url_fseek(pb, opcode_size, SEEK_CUR);
425
            avio_seek(pb, opcode_size, SEEK_CUR);
426 426
            break;
427 427

  
428 428
        case OPCODE_SET_PALETTE:
......
464 464

  
465 465
        case OPCODE_SET_PALETTE_COMPRESSED:
466 466
            debug_ipmovie("set palette compressed\n");
467
            url_fseek(pb, opcode_size, SEEK_CUR);
467
            avio_seek(pb, opcode_size, SEEK_CUR);
468 468
            break;
469 469

  
470 470
        case OPCODE_SET_DECODING_MAP:
......
473 473
            /* log position and move on for now */
474 474
            s->decode_map_chunk_offset = url_ftell(pb);
475 475
            s->decode_map_chunk_size = opcode_size;
476
            url_fseek(pb, opcode_size, SEEK_CUR);
476
            avio_seek(pb, opcode_size, SEEK_CUR);
477 477
            break;
478 478

  
479 479
        case OPCODE_VIDEO_DATA:
......
482 482
            /* log position and move on for now */
483 483
            s->video_chunk_offset = url_ftell(pb);
484 484
            s->video_chunk_size = opcode_size;
485
            url_fseek(pb, opcode_size, SEEK_CUR);
485
            avio_seek(pb, opcode_size, SEEK_CUR);
486 486
            break;
487 487

  
488 488
        default:
......
553 553
        CHUNK_PREAMBLE_SIZE)
554 554
        return AVERROR(EIO);
555 555
    chunk_type = AV_RL16(&chunk_preamble[2]);
556
    url_fseek(pb, -CHUNK_PREAMBLE_SIZE, SEEK_CUR);
556
    avio_seek(pb, -CHUNK_PREAMBLE_SIZE, SEEK_CUR);
557 557

  
558 558
    if (chunk_type == CHUNK_VIDEO)
559 559
        ipmovie->audio_type = CODEC_ID_NONE;  /* no audio */
libavformat/libnut.c
182 182
        pos = url_fsize(bc) + pos;
183 183
        whence = SEEK_SET;
184 184
    }
185
    return url_fseek(bc, pos, whence);
185
    return avio_seek(bc, pos, whence);
186 186
}
187 187

  
188 188
static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
libavformat/matroskadec.c
831 831
                     return ebml_parse_nest(matroska, syntax->def.n, data);
832 832
    case EBML_PASS:  return ebml_parse_id(matroska, syntax->def.n, id, data);
833 833
    case EBML_STOP:  return 1;
834
    default:         return url_fseek(pb,length,SEEK_CUR)<0 ? AVERROR(EIO) : 0;
834
    default:         return avio_seek(pb,length,SEEK_CUR)<0 ? AVERROR(EIO) : 0;
835 835
    }
836 836
    if (res == AVERROR_INVALIDDATA)
837 837
        av_log(matroska->ctx, AV_LOG_ERROR, "Invalid element\n");
......
1130 1130
            continue;
1131 1131

  
1132 1132
        /* seek */
1133
        if (url_fseek(matroska->ctx->pb, offset, SEEK_SET) != offset)
1133
        if (avio_seek(matroska->ctx->pb, offset, SEEK_SET) != offset)
1134 1134
            continue;
1135 1135

  
1136 1136
        /* We don't want to lose our seekhead level, so we add
......
1159 1159
    }
1160 1160

  
1161 1161
    /* seek back */
1162
    url_fseek(matroska->ctx->pb, before_pos, SEEK_SET);
1162
    avio_seek(matroska->ctx->pb, before_pos, SEEK_SET);
1163 1163
    matroska->level_up = level_up;
1164 1164
    matroska->current_id = saved_id;
1165 1165
}
......
1889 1889
    timestamp = FFMAX(timestamp, st->index_entries[0].timestamp);
1890 1890

  
1891 1891
    if ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
1892
        url_fseek(s->pb, st->index_entries[st->nb_index_entries-1].pos, SEEK_SET);
1892
        avio_seek(s->pb, st->index_entries[st->nb_index_entries-1].pos, SEEK_SET);
1893 1893
        while ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
1894 1894
            matroska_clear_queue(matroska);
1895 1895
            if (matroska_parse_cluster(matroska) < 0)
......
1914 1914
        }
1915 1915
    }
1916 1916

  
1917
    url_fseek(s->pb, st->index_entries[index_min].pos, SEEK_SET);
1917
    avio_seek(s->pb, st->index_entries[index_min].pos, SEEK_SET);
1918 1918
    matroska->skip_to_keyframe = !(flags & AVSEEK_FLAG_ANY);
1919 1919
    matroska->skip_to_timecode = st->index_entries[index].timestamp;
1920 1920
    matroska->done = 0;
libavformat/matroskaenc.c
231 231
{
232 232
    int64_t pos = url_ftell(pb);
233 233

  
234
    if (url_fseek(pb, master.pos - master.sizebytes, SEEK_SET) < 0)
234
    if (avio_seek(pb, master.pos - master.sizebytes, SEEK_SET) < 0)
235 235
        return;
236 236
    put_ebml_num(pb, pos - master.pos, master.sizebytes);
237
    url_fseek(pb, pos, SEEK_SET);
237
    avio_seek(pb, pos, SEEK_SET);
238 238
}
239 239

  
240 240
static void put_xiph_size(AVIOContext *pb, int size)
......
313 313
    currentpos = url_ftell(pb);
314 314

  
315 315
    if (seekhead->reserved_size > 0)
316
        if (url_fseek(pb, seekhead->filepos, SEEK_SET) < 0)
316
        if (avio_seek(pb, seekhead->filepos, SEEK_SET) < 0)
317 317
            return -1;
318 318

  
319 319
    metaseek = start_ebml_master(pb, MATROSKA_ID_SEEKHEAD, seekhead->reserved_size);
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff