Commit f59d8ff8 authored by Anton Khirnov's avatar Anton Khirnov Committed by Michael Niedermayer

avio: avio_ prefix for url_fseek

Signed-off-by: default avatarRonald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 6b4aa5da)
parent e9e9139c
......@@ -106,7 +106,7 @@ static int fourxm_read_header(AVFormatContext *s,
fourxm->fps = 1.0;
/* skip the first 3 32-bit numbers */
url_fseek(pb, 12, SEEK_CUR);
avio_seek(pb, 12, SEEK_CUR);
/* check for LIST-HEAD */
GET_LIST_HEADER();
......@@ -322,12 +322,12 @@ static int fourxm_read_packet(AVFormatContext *s,
fourxm->tracks[track_number].audio_pts += audio_frame_count;
} else {
url_fseek(pb, size, SEEK_CUR);
avio_seek(pb, size, SEEK_CUR);
}
break;
default:
url_fseek(pb, size, SEEK_CUR);
avio_seek(pb, size, SEEK_CUR);
break;
}
}
......
......@@ -152,7 +152,7 @@ static unsigned int get_aiff_header(AVIOContext *pb, AVCodecContext *codec,
/* Chunk is over */
if (size)
url_fseek(pb, size, SEEK_CUR);
avio_seek(pb, size, SEEK_CUR);
return num_frames;
}
......@@ -276,7 +276,7 @@ got_sound:
st->nb_frames * st->codec->frame_size : st->nb_frames;
/* Position the stream at the first block */
url_fseek(pb, offset, SEEK_SET);
avio_seek(pb, offset, SEEK_SET);
return 0;
}
......
......@@ -126,19 +126,19 @@ static int aiff_write_trailer(AVFormatContext *s)
if (!url_is_streamed(s->pb)) {
/* File length */
url_fseek(pb, aiff->form, SEEK_SET);
avio_seek(pb, aiff->form, SEEK_SET);
avio_wb32(pb, file_size - aiff->form - 4);
/* Number of sample frames */
url_fseek(pb, aiff->frames, SEEK_SET);
avio_seek(pb, aiff->frames, SEEK_SET);
avio_wb32(pb, (file_size-aiff->ssnd-12)/enc->block_align);
/* Sound Data chunk size */
url_fseek(pb, aiff->ssnd, SEEK_SET);
avio_seek(pb, aiff->ssnd, SEEK_SET);
avio_wb32(pb, file_size - aiff->ssnd - 4);
/* return to the end */
url_fseek(pb, end_size, SEEK_SET);
avio_seek(pb, end_size, SEEK_SET);
put_flush_packet(pb);
}
......
......@@ -143,7 +143,7 @@ static int read_header(AVFormatContext *s,
goto close_and_return;
/* read page table */
ret = url_fseek(pb, anm->page_table_offset, SEEK_SET);
ret = avio_seek(pb, anm->page_table_offset, SEEK_SET);
if (ret < 0)
goto close_and_return;
......@@ -192,7 +192,7 @@ repeat:
/* parse page header */
if (anm->record < 0) {
url_fseek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16), SEEK_SET);
avio_seek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16), SEEK_SET);
url_fskip(pb, 8 + 2*p->nb_records);
anm->record = 0;
}
......@@ -209,10 +209,10 @@ repeat:
/* fetch record size */
tmp = url_ftell(pb);
url_fseek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16) +
avio_seek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16) +
8 + anm->record * 2, SEEK_SET);
record_size = avio_rl16(pb);
url_fseek(pb, tmp, SEEK_SET);
avio_seek(pb, tmp, SEEK_SET);
/* fetch record */
pkt->size = av_get_packet(s->pb, pkt, record_size);
......
......@@ -187,7 +187,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
/* Skip any unknown bytes at the end of the descriptor.
This is for future compatibility */
if (ape->descriptorlength > 52)
url_fseek(pb, ape->descriptorlength - 52, SEEK_CUR);
avio_seek(pb, ape->descriptorlength - 52, SEEK_CUR);
/* Read header data */
ape->compressiontype = avio_rl16(pb);
......@@ -212,7 +212,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
ape->finalframeblocks = avio_rl32(pb);
if (ape->formatflags & MAC_FORMAT_FLAG_HAS_PEAK_LEVEL) {
url_fseek(pb, 4, SEEK_CUR); /* Skip the peak level */
avio_seek(pb, 4, SEEK_CUR); /* Skip the peak level */
ape->headerlength += 4;
}
......@@ -289,7 +289,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
/* try to read APE tags */
if (!url_is_streamed(pb)) {
ff_ape_parse_tag(s);
url_fseek(pb, 0, SEEK_SET);
avio_seek(pb, 0, SEEK_SET);
}
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,7 +342,7 @@ static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
if (ape->currentframe > ape->totalframes)
return AVERROR(EIO);
url_fseek (s->pb, ape->frames[ape->currentframe].pos, SEEK_SET);
avio_seek (s->pb, ape->frames[ape->currentframe].pos, SEEK_SET);
/* Calculate how many blocks there are in this frame */
if (ape->currentframe == (ape->totalframes - 1))
......
......@@ -74,7 +74,7 @@ void ff_ape_parse_tag(AVFormatContext *s)
if (file_size < APE_TAG_FOOTER_BYTES)
return;
url_fseek(pb, file_size - APE_TAG_FOOTER_BYTES, SEEK_SET);
avio_seek(pb, file_size - APE_TAG_FOOTER_BYTES, SEEK_SET);
avio_read(pb, buf, 8); /* APETAGEX */
if (strncmp(buf, "APETAGEX", 8)) {
......@@ -105,7 +105,7 @@ void ff_ape_parse_tag(AVFormatContext *s)
return;
}
url_fseek(pb, file_size - tag_bytes, SEEK_SET);
avio_seek(pb, file_size - tag_bytes, SEEK_SET);
for (i=0; i<fields; i++)
if (ape_tag_read_field(s) < 0) break;
......
......@@ -181,7 +181,7 @@ static void get_tag(AVFormatContext *s, const char *key, int type, int len)
av_metadata_set2(&s->metadata, key, value, 0);
finish:
av_freep(&value);
url_fseek(s->pb, off + len, SEEK_SET);
avio_seek(s->pb, off + len, SEEK_SET);
}
static int asf_read_file_properties(AVFormatContext *s, int64_t size)
......@@ -427,14 +427,14 @@ static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size)
for (i=0; i<stream_ct; i++){
avio_rl16(pb);
ext_len = avio_rl16(pb);
url_fseek(pb, ext_len, SEEK_CUR);
avio_seek(pb, ext_len, SEEK_CUR);
}
for (i=0; i<payload_ext_ct; i++){
ff_get_guid(pb, &g);
ext_d=avio_rl16(pb);
ext_len=avio_rl32(pb);
url_fseek(pb, ext_len, SEEK_CUR);
avio_seek(pb, ext_len, SEEK_CUR);
}
return 0;
......@@ -653,7 +653,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
if(url_ftell(pb) != gpos + gsize)
av_log(s, AV_LOG_DEBUG, "gpos mismatch our pos=%"PRIu64", end=%"PRIu64"\n", url_ftell(pb)-gpos, gsize);
url_fseek(pb, gpos + gsize, SEEK_SET);
avio_seek(pb, gpos + gsize, SEEK_SET);
}
ff_get_guid(pb, &g);
avio_rl64(pb);
......@@ -757,7 +757,7 @@ static int ff_asf_get_packet(AVFormatContext *s, AVIOContext *pb)
d= avio_r8(pb);
rsize+=3;
}else{
url_fseek(pb, -1, SEEK_CUR); //FIXME
avio_seek(pb, -1, SEEK_CUR); //FIXME
}
asf->packet_flags = c;
......@@ -1145,7 +1145,7 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos,
if (s->packet_size > 0)
pos= (pos+s->packet_size-1-s->data_offset)/s->packet_size*s->packet_size+ s->data_offset;
*ppos= pos;
url_fseek(s->pb, pos, SEEK_SET);
avio_seek(s->pb, pos, SEEK_SET);
//printf("asf_read_pts\n");
asf_reset_header(s);
......@@ -1187,7 +1187,7 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
int64_t current_pos= url_ftell(s->pb);
int i;
url_fseek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET);
avio_seek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET);
ff_get_guid(s->pb, &g);
/* the data object can be followed by other top-level objects,
......@@ -1195,10 +1195,10 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
while (ff_guidcmp(&g, &index_guid)) {
int64_t gsize= avio_rl64(s->pb);
if (gsize < 24 || url_feof(s->pb)) {
url_fseek(s->pb, current_pos, SEEK_SET);
avio_seek(s->pb, current_pos, SEEK_SET);
return;
}
url_fseek(s->pb, gsize-24, SEEK_CUR);
avio_seek(s->pb, gsize-24, SEEK_CUR);
ff_get_guid(s->pb, &g);
}
......@@ -1226,7 +1226,7 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
}
asf->index_read= 1;
}
url_fseek(s->pb, current_pos, SEEK_SET);
avio_seek(s->pb, current_pos, SEEK_SET);
}
static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags)
......@@ -1264,7 +1264,7 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
// various attempts to find key frame have failed so far
// asf_reset_header(s);
// url_fseek(s->pb, pos, SEEK_SET);
// avio_seek(s->pb, pos, SEEK_SET);
// key_pos = pos;
// for(i=0;i<16;i++){
// pos = url_ftell(s->pb);
......@@ -1285,7 +1285,7 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
/* do the seek */
av_log(s, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos);
url_fseek(s->pb, pos, SEEK_SET);
avio_seek(s->pb, pos, SEEK_SET);
}
asf_reset_header(s);
return 0;
......
......@@ -260,9 +260,9 @@ static void end_header(AVIOContext *pb, int64_t pos)
int64_t pos1;
pos1 = url_ftell(pb);
url_fseek(pb, pos + 16, SEEK_SET);
avio_seek(pb, pos + 16, SEEK_SET);
avio_wl64(pb, pos1 - pos);
url_fseek(pb, pos1, SEEK_SET);
avio_seek(pb, pos1, SEEK_SET);
}
/* write an asf chunk (only used in streaming case) */
......@@ -443,9 +443,9 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
return -1;
if (wavsize != extra_size) {
cur_pos = url_ftell(pb);
url_fseek(pb, es_pos, SEEK_SET);
avio_seek(pb, es_pos, SEEK_SET);
avio_wl32(pb, wavsize); /* wav header len */
url_fseek(pb, cur_pos, SEEK_SET);
avio_seek(pb, cur_pos, SEEK_SET);
}
/* ERROR Correction */
avio_w8(pb, 0x01);
......@@ -530,17 +530,17 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
if (asf->is_streamed) {
header_size += 8 + 30 + 50;
url_fseek(pb, header_offset - 10 - 30, SEEK_SET);
avio_seek(pb, header_offset - 10 - 30, SEEK_SET);
avio_wl16(pb, header_size);
url_fseek(pb, header_offset - 2 - 30, SEEK_SET);
avio_seek(pb, header_offset - 2 - 30, SEEK_SET);
avio_wl16(pb, header_size);
header_size -= 8 + 30 + 50;
}
header_size += 24 + 6;
url_fseek(pb, header_offset - 14, SEEK_SET);
avio_seek(pb, header_offset - 14, SEEK_SET);
avio_wl64(pb, header_size);
url_fseek(pb, cur_pos, SEEK_SET);
avio_seek(pb, cur_pos, SEEK_SET);
/* movie chunk, followed by packets of packet_size */
asf->data_offset = cur_pos;
......@@ -871,7 +871,7 @@ static int asf_write_trailer(AVFormatContext *s)
} else {
/* rewrite an updated header */
file_size = url_ftell(s->pb);
url_fseek(s->pb, 0, SEEK_SET);
avio_seek(s->pb, 0, SEEK_SET);
asf_write_header1(s, file_size, data_size - asf->data_offset);
}
......
......@@ -95,9 +95,9 @@ static int au_write_trailer(AVFormatContext *s)
/* update file size */
file_size = url_ftell(pb);
url_fseek(pb, 8, SEEK_SET);
avio_seek(pb, 8, SEEK_SET);
avio_wb32(pb, (uint32_t)(file_size - 24));
url_fseek(pb, file_size, SEEK_SET);
avio_seek(pb, file_size, SEEK_SET);
put_flush_packet(pb);
}
......@@ -147,7 +147,7 @@ static int au_read_header(AVFormatContext *s,
if (size >= 24) {
/* skip unused data */
url_fseek(pb, size - 24, SEEK_CUR);
avio_seek(pb, size - 24, SEEK_CUR);
}
/* now we are ready: build format streams */
......
......@@ -205,13 +205,13 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
return -1;
}
url_fseek(pb, offset+8, SEEK_SET);
avio_seek(pb, offset+8, SEEK_SET);
avi->odml_depth++;
read_braindead_odml_indx(s, frame_num);
avi->odml_depth--;
frame_num += duration;
url_fseek(pb, pos, SEEK_SET);
avio_seek(pb, pos, SEEK_SET);
}
}
avi->index_loaded=1;
......@@ -668,7 +668,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
if(!url_is_streamed(pb) && !(s->flags & AVFMT_FLAG_IGNIDX)){
read_braindead_odml_indx(s, 0);
}
url_fseek(pb, i+size, SEEK_SET);
avio_seek(pb, i+size, SEEK_SET);
break;
case MKTAG('v', 'p', 'r', 'p'):
if(stream_index < (unsigned)s->nb_streams && size > 9*4){
......@@ -693,7 +693,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
size -= 9*4;
}
url_fseek(pb, size, SEEK_CUR);
avio_seek(pb, size, SEEK_CUR);
break;
case MKTAG('s', 't', 'r', 'n'):
if(s->nb_streams){
......@@ -892,7 +892,7 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
if(i>=0){
int64_t pos= best_st->index_entries[i].pos;
pos += best_ast->packet_size - best_ast->remaining;
url_fseek(s->pb, pos + 8, SEEK_SET);
avio_seek(s->pb, pos + 8, SEEK_SET);
// av_log(s, AV_LOG_DEBUG, "pos=%"PRId64"\n", pos);
assert(best_ast->remaining <= best_ast->packet_size);
......@@ -1174,7 +1174,7 @@ static int guess_ni_flag(AVFormatContext *s){
if(n >= 2){
int64_t pos= st->index_entries[0].pos;
url_fseek(s->pb, pos + 4, SEEK_SET);
avio_seek(s->pb, pos + 4, SEEK_SET);
size= avio_rl32(s->pb);
if(pos + size > st->index_entries[1].pos)
last_start= INT64_MAX;
......@@ -1185,7 +1185,7 @@ static int guess_ni_flag(AVFormatContext *s){
if(st->index_entries[n-1].pos < first_end)
first_end= st->index_entries[n-1].pos;
}
url_fseek(s->pb, oldpos, SEEK_SET);
avio_seek(s->pb, oldpos, SEEK_SET);
return last_start > first_end;
}
......@@ -1197,7 +1197,7 @@ static int avi_load_index(AVFormatContext *s)
int64_t pos= url_ftell(pb);
int ret = -1;
if (url_fseek(pb, avi->movi_end, SEEK_SET) < 0)
if (avio_seek(pb, avi->movi_end, SEEK_SET) < 0)
goto the_end; // maybe truncated file
#ifdef DEBUG_SEEK
printf("movi_end=0x%"PRIx64"\n", avi->movi_end);
......@@ -1225,13 +1225,13 @@ static int avi_load_index(AVFormatContext *s)
default:
skip:
size += (size & 1);
if (url_fseek(pb, size, SEEK_CUR) < 0)
if (avio_seek(pb, size, SEEK_CUR) < 0)
goto the_end; // something is wrong here
break;
}
}
the_end:
url_fseek(pb, pos, SEEK_SET);
avio_seek(pb, pos, SEEK_SET);
return ret;
}
......@@ -1282,7 +1282,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
/* DV demux so it can synthesize correct timestamps. */
dv_offset_reset(avi->dv_demux, timestamp);
url_fseek(s->pb, pos, SEEK_SET);
avio_seek(s->pb, pos, SEEK_SET);
avi->stream_index= -1;
return 0;
}
......@@ -1324,7 +1324,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
}
/* do the seek */
url_fseek(s->pb, pos, SEEK_SET);
avio_seek(s->pb, pos, SEEK_SET);
avi->stream_index= -1;
return 0;
}
......
......@@ -130,7 +130,7 @@ static int avi_write_counters(AVFormatContext* s, int riff_id)
assert(avist->frames_hdr_strm);
stream = s->streams[n]->codec;
url_fseek(pb, avist->frames_hdr_strm, SEEK_SET);
avio_seek(pb, avist->frames_hdr_strm, SEEK_SET);
ff_parse_specific_params(stream, &au_byterate, &au_ssize, &au_scale);
if(au_ssize == 0) {
avio_wl32(pb, avist->packet_count);
......@@ -142,10 +142,10 @@ static int avi_write_counters(AVFormatContext* s, int riff_id)
}
if(riff_id == 1) {
assert(avi->frames_hdr_all);
url_fseek(pb, avi->frames_hdr_all, SEEK_SET);
avio_seek(pb, avi->frames_hdr_all, SEEK_SET);
avio_wl32(pb, nb_frames);
}
url_fseek(pb, file_size, SEEK_SET);
avio_seek(pb, file_size, SEEK_SET);
return 0;
}
......@@ -442,7 +442,7 @@ static int avi_write_ix(AVFormatContext *s)
pos = url_ftell(pb);
/* Updating one entry in the AVI OpenDML master index */
url_fseek(pb, avist->indexes.indx_start - 8, SEEK_SET);
avio_seek(pb, avist->indexes.indx_start - 8, SEEK_SET);
ffio_wfourcc(pb, "indx"); /* enabling this entry */
url_fskip(pb, 8);
avio_wl32(pb, avi->riff_id); /* nEntriesInUse */
......@@ -451,7 +451,7 @@ static int avi_write_ix(AVFormatContext *s)
avio_wl32(pb, pos - ix); /* dwSize */
avio_wl32(pb, avist->indexes.entry); /* dwDuration */
url_fseek(pb, pos, SEEK_SET);
avio_seek(pb, pos, SEEK_SET);
}
return 0;
}
......@@ -601,7 +601,7 @@ static int avi_write_trailer(AVFormatContext *s)
ff_end_tag(pb, avi->riff_start);
file_size = url_ftell(pb);
url_fseek(pb, avi->odml_list - 8, SEEK_SET);
avio_seek(pb, avi->odml_list - 8, SEEK_SET);
ffio_wfourcc(pb, "LIST"); /* Making this AVI OpenDML one */
url_fskip(pb, 16);
......@@ -619,7 +619,7 @@ static int avi_write_trailer(AVFormatContext *s)
}
}
avio_wl32(pb, nb_frames);
url_fseek(pb, file_size, SEEK_SET);
avio_seek(pb, file_size, SEEK_SET);
avi_write_counters(s, avi->riff_id);
}
......
......@@ -420,6 +420,7 @@ attribute_deprecated void put_tag(AVIOContext *s, const char *tag);
*/
attribute_deprecated int url_fopen( AVIOContext **s, const char *url, int flags);
attribute_deprecated int url_fclose(AVIOContext *s);
attribute_deprecated int64_t url_fseek(AVIOContext *s, int64_t offset, int whence);
/**
* @}
*/
......@@ -465,7 +466,7 @@ int avio_put_str16le(AVIOContext *s, const char *str);
* fseek() equivalent for AVIOContext.
* @return new position or AVERROR.
*/
int64_t url_fseek(AVIOContext *s, int64_t offset, int whence);
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
/**
* Skip given number of bytes forward.
......
......@@ -176,7 +176,7 @@ void put_flush_packet(AVIOContext *s)
s->must_flush = 0;
}
int64_t url_fseek(AVIOContext *s, int64_t offset, int whence)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
{
int64_t offset1;
int64_t pos;
......@@ -235,13 +235,13 @@ int64_t url_fseek(AVIOContext *s, int64_t offset, int whence)
int url_fskip(AVIOContext *s, int64_t offset)
{
int64_t ret = url_fseek(s, offset, SEEK_CUR);
int64_t ret = avio_seek(s, offset, SEEK_CUR);
return ret < 0 ? ret : 0;
}
int64_t url_ftell(AVIOContext *s)
{
return url_fseek(s, 0, SEEK_CUR);
return avio_seek(s, 0, SEEK_CUR);
}
int64_t url_fsize(AVIOContext *s)
......@@ -365,6 +365,10 @@ int url_fclose(AVIOContext *s)
{
return avio_close(s);
}
int64_t url_fseek(AVIOContext *s, int64_t offset, int whence)
{
return avio_seek(s, offset, whence);
}
#endif
int avio_put_str(AVIOContext *s, const char *str)
......
......@@ -67,7 +67,7 @@ static int vid_read_header(AVFormatContext *s,
* bytes: 'V' 'I' 'D'
* int16s: always_512, nframes, width, height, delay, always_14
*/
url_fseek(pb, 5, SEEK_CUR);
avio_seek(pb, 5, SEEK_CUR);
vid->nframes = avio_rl16(pb);
stream = av_new_stream(s, 0);
......@@ -146,7 +146,7 @@ static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt,
if(bytes_copied == npixels){ // sometimes no stop character is given, need to keep track of bytes copied
// may contain a 0 byte even if read all pixels
if(avio_r8(pb))
url_fseek(pb, -1, SEEK_CUR);
avio_seek(pb, -1, SEEK_CUR);
break;
}
if(bytes_copied > npixels)
......@@ -185,7 +185,7 @@ static int vid_read_packet(AVFormatContext *s,
block_type = avio_r8(pb);
switch(block_type){
case PALETTE_BLOCK:
url_fseek(pb, -1, SEEK_CUR); // include block type
avio_seek(pb, -1, SEEK_CUR); // include block type
ret_value = av_get_packet(pb, pkt, 3 * 256 + 1);
if(ret_value != 3 * 256 + 1){
av_free_packet(pkt);
......
......@@ -98,7 +98,7 @@ static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap)
astream->codec->bits_per_coded_sample = 8;
astream->codec->bit_rate =
astream->codec->sample_rate * astream->codec->bits_per_coded_sample;
url_fseek(pb, chunk_header - 3, SEEK_SET);
avio_seek(pb, chunk_header - 3, SEEK_SET);
av_set_pts_info(astream, 64, 1, astream->codec->sample_rate);
return 0;
}
......
......@@ -225,7 +225,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
AV_RL32(pkt->data) / (2 * s->streams[bink->current_track]->codec->channels);
return 0;
} else {
url_fseek(pb, audio_size, SEEK_CUR);
avio_seek(pb, audio_size, SEEK_CUR);
}
}
......@@ -251,7 +251,7 @@ static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, in
return -1;
/* seek to the first frame */
url_fseek(s->pb, vst->index_entries[0].pos, SEEK_SET);
avio_seek(s->pb, vst->index_entries[0].pos, SEEK_SET);
bink->video_pts = 0;
memset(bink->audio_pts, 0, sizeof(bink->audio_pts));
bink->current_track = -1;
......
......@@ -140,13 +140,13 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
}
if (c93->current_frame == 0) {
url_fseek(pb, br->index * 2048, SEEK_SET);
avio_seek(pb, br->index * 2048, SEEK_SET);
for (i = 0; i < 32; i++) {
c93->frame_offsets[i] = avio_rl32(pb);
}
}
url_fseek(pb,br->index * 2048 +
avio_seek(pb,br->index * 2048 +
c93->frame_offsets[c93->current_frame], SEEK_SET);
datasize = avio_rl16(pb); /* video frame size */
......
......@@ -292,7 +292,7 @@ static int read_header(AVFormatContext *s,
/* position the stream at the start of data */
if (caf->data_size >= 0)
url_fseek(pb, caf->data_start, SEEK_SET);
avio_seek(pb, caf->data_start, SEEK_SET);
return 0;
}
......@@ -377,7 +377,7 @@ static int read_seek(AVFormatContext *s, int stream_index,
return -1;
}
url_fseek(s->pb, pos + caf->data_start, SEEK_SET);
avio_seek(s->pb, pos + caf->data_start, SEEK_SET);
return 0;
}
......
......@@ -419,7 +419,7 @@ static int dv_read_header(AVFormatContext *s,
if (state == 0x003f0700 || state == 0xff3f0700)
marker_pos = url_ftell(s->pb);
if (state == 0xff3f0701 && url_ftell(s->pb) - marker_pos == 80) {
url_fseek(s->pb, -163, SEEK_CUR);
avio_seek(s->pb, -163, SEEK_CUR);
state = avio_rb32(s->pb);
break;
}
......@@ -428,7 +428,7 @@ static int dv_read_header(AVFormatContext *s,
AV_WB32(c->buf, state);
if (avio_read(s->pb, c->buf + 4, DV_PROFILE_BYTES - 4) <= 0 ||
url_fseek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
avio_seek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
return AVERROR(EIO);
c->dv_demux->sys = ff_dv_frame_profile(c->dv_demux->sys, c->buf, DV_PROFILE_BYTES);
......@@ -473,7 +473,7 @@ static int dv_read_seek(AVFormatContext *s, int stream_index,
dv_offset_reset(c, offset / c->sys->frame_size);
offset = url_fseek(s->pb, offset, SEEK_SET);
offset = avio_seek(s->pb, offset, SEEK_SET);
return (offset < 0) ? offset : 0;
}
......
......@@ -115,7 +115,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
c->bpc = ((c->bpc + ast->codec->block_align - 1) / ast->codec->block_align) * ast->codec->block_align;
c->bytes_left = fsize;
c->wavpos = url_ftell(pb);
url_fseek(pb, c->vidpos, SEEK_SET);
avio_seek(pb, c->vidpos, SEEK_SET);
}
/* now we are ready: build format streams */
......@@ -151,7 +151,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
if(!c->readvid && c->has_sound && c->bytes_left){
c->readvid = 1;
url_fseek(s->pb, c->wavpos, SEEK_SET);
avio_seek(s->pb, c->wavpos, SEEK_SET);
size = FFMIN(c->bytes_left, c->bpc);
ret = av_get_packet(s->pb, pkt, size);
pkt->stream_index = 1;
......@@ -161,7 +161,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
c->wavpos = url_ftell(s->pb);
return 0;
}
url_fseek(s->pb, c->vidpos, SEEK_SET);
avio_seek(s->pb, c->vidpos, SEEK_SET);
while(!url_feof(s->pb) && c->frames){
avio_read(s->pb, buf, 4);
switch(AV_RL32(buf)){
......
......@@ -369,10 +369,10 @@ static int process_ea_header(AVFormatContext *s) {
return err;
}
url_fseek(pb, startpos + size, SEEK_SET);
avio_seek(pb, startpos + size, SEEK_SET);
}
url_fseek(pb, 0, SEEK_SET);
avio_seek(pb, 0, SEEK_SET);
return 1;
}
......@@ -536,12 +536,12 @@ static int ea_read_packet(AVFormatContext *s,
case fVGT_TAG:
case MADm_TAG:
case MADe_TAG:
url_fseek(pb, -8, SEEK_CUR); // include chunk preamble