Commit e356fc57 authored by Anton Khirnov's avatar Anton Khirnov Committed by Ronald S. Bultje

lavf: replace all uses of url_fskip with avio_seek

Signed-off-by: default avatarRonald S. Bultje <rsbultje@gmail.com>
parent 6b4aa5da
......@@ -62,9 +62,9 @@ static int aea_read_header(AVFormatContext *s,
return AVERROR(ENOMEM);
/* Parse the amount of channels and skip to pos 2048(0x800) */
url_fskip(s->pb, 264);
avio_seek(s->pb, 264, SEEK_CUR);
st->codec->channels = avio_r8(s->pb);
url_fskip(s->pb, 1783);
avio_seek(s->pb, 1783, SEEK_CUR);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -70,7 +70,7 @@ static void get_meta(AVFormatContext *s, const char *key, int size)
int res;
if (!str) {
url_fskip(s->pb, size);
avio_seek(s->pb, size, SEEK_CUR);
return;
}
......@@ -242,7 +242,7 @@ static int aiff_read_header(AVFormatContext *s,
av_log(s, AV_LOG_ERROR, "file is not seekable\n");
return -1;
}
url_fskip(pb, size - 8);
avio_seek(pb, size - 8, SEEK_CUR);
break;
case MKTAG('w', 'a', 'v', 'e'):
if ((uint64_t)size > (1<<30))
......@@ -256,7 +256,7 @@ static int aiff_read_header(AVFormatContext *s,
default: /* Jump */
if (size & 1) /* Always even aligned */
size++;
url_fskip (pb, size);
avio_seek(pb, size, SEEK_CUR);
}
}
......
......@@ -83,7 +83,7 @@ static int read_header(AVFormatContext *s,
AVStream *st;
int i, ret;
url_fskip(pb, 4); /* magic number */
avio_seek(pb, 4, SEEK_CUR); /* magic number */
if (avio_rl16(pb) != MAX_PAGES) {
av_log_ask_for_sample(s, "max_pages != " AV_STRINGIFY(MAX_PAGES) "\n");
return AVERROR_INVALIDDATA;
......@@ -91,7 +91,7 @@ static int read_header(AVFormatContext *s,
anm->nb_pages = avio_rl16(pb);
anm->nb_records = avio_rl32(pb);
url_fskip(pb, 2); /* max records per page */
avio_seek(pb, 2, SEEK_CUR); /* max records per page */
anm->page_table_offset = avio_rl16(pb);
if (avio_rl32(pb) != ANIM_TAG)
return AVERROR_INVALIDDATA;
......@@ -107,13 +107,13 @@ static int read_header(AVFormatContext *s,
st->codec->height = avio_rl16(pb);
if (avio_r8(pb) != 0)
goto invalid;
url_fskip(pb, 1); /* frame rate multiplier info */
avio_seek(pb, 1, SEEK_CUR); /* frame rate multiplier info */
/* ignore last delta record (used for looping) */
if (avio_r8(pb)) /* has_last_delta */
anm->nb_records = FFMAX(anm->nb_records - 1, 0);
url_fskip(pb, 1); /* last_delta_valid */
avio_seek(pb, 1, SEEK_CUR); /* last_delta_valid */
if (avio_r8(pb) != 0)
goto invalid;
......@@ -121,15 +121,15 @@ static int read_header(AVFormatContext *s,
if (avio_r8(pb) != 1)
goto invalid;
url_fskip(pb, 1); /* other recs per frame */
avio_seek(pb, 1, SEEK_CUR); /* other recs per frame */
if (avio_r8(pb) != 1)
goto invalid;
url_fskip(pb, 32); /* record_types */
avio_seek(pb, 32, SEEK_CUR); /* record_types */
st->nb_frames = avio_rl32(pb);
av_set_pts_info(st, 64, 1, avio_rl16(pb));
url_fskip(pb, 58);
avio_seek(pb, 58, SEEK_CUR);
/* color cycling and palette data */
st->codec->extradata_size = 16*8 + 4*256;
......@@ -193,7 +193,7 @@ repeat:
/* parse page header */
if (anm->record < 0) {
avio_seek(pb, anm->page_table_offset + MAX_PAGES*6 + (anm->page<<16), SEEK_SET);
url_fskip(pb, 8 + 2*p->nb_records);
avio_seek(pb, 8 + 2*p->nb_records, SEEK_CUR);
anm->record = 0;
}
......
......@@ -239,7 +239,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
/* Skip any stored wav header */
if (!(ape->formatflags & MAC_FORMAT_FLAG_CREATE_WAV_HEADER))
url_fskip(pb, ape->wavheaderlength);
avio_seek(pb, ape->wavheaderlength, SEEK_CUR);
}
if(ape->totalframes > UINT_MAX / sizeof(APEFrame)){
......
......@@ -350,7 +350,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
avio_rl16(pb); /* panes */
st->codec->bits_per_coded_sample = avio_rl16(pb); /* depth */
tag1 = avio_rl32(pb);
url_fskip(pb, 20);
avio_seek(pb, 20, SEEK_CUR);
// av_log(s, AV_LOG_DEBUG, "size:%d tsize:%d sizeX:%d\n", size, total_size, sizeX);
if (sizeX > 40) {
st->codec->extradata_size = sizeX - 40;
......@@ -388,7 +388,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
st->need_parsing = AVSTREAM_PARSE_FULL_ONCE;
}
pos2 = url_ftell(pb);
url_fskip(pb, size - (pos2 - pos1 + 24));
avio_seek(pb, size - (pos2 - pos1 + 24), SEEK_CUR);
return 0;
}
......@@ -455,7 +455,7 @@ static int asf_read_content_desc(AVFormatContext *s, int64_t size)
get_tag(s, "author" , 0, len2);
get_tag(s, "copyright", 0, len3);
get_tag(s, "comment" , 0, len4);
url_fskip(pb, len5);
avio_seek(pb, len5, SEEK_CUR);
return 0;
}
......@@ -475,7 +475,7 @@ static int asf_read_ext_content_desc(AVFormatContext *s, int64_t size)
if (name_len%2) // must be even, broken lavf versions wrote len-1
name_len += 1;
if ((ret = avio_get_str16le(pb, name_len, name, sizeof(name))) < name_len)
url_fskip(pb, name_len - ret);
avio_seek(pb, name_len - ret, SEEK_CUR);
value_type = avio_rl16(pb);
value_len = avio_rl16(pb);
if (!value_type && value_len%2)
......@@ -505,7 +505,7 @@ static int asf_read_language_list(AVFormatContext *s, int64_t size)
char lang[6];
unsigned int lang_len = avio_r8(pb);
if ((ret = avio_get_str16le(pb, lang_len, lang, sizeof(lang))) < lang_len)
url_fskip(pb, lang_len - ret);
avio_seek(pb, lang_len - ret, SEEK_CUR);
if (j < 128)
av_strlcpy(asf->stream_languages[j], lang, sizeof(*asf->stream_languages));
}
......@@ -531,10 +531,10 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size)
value_len= avio_rl32(pb);
if ((ret = avio_get_str16le(pb, name_len, name, sizeof(name))) < name_len)
url_fskip(pb, name_len - ret);
avio_seek(pb, name_len - ret, SEEK_CUR);
//av_log(s, AV_LOG_ERROR, "%d %d %d %d %d <%s>\n", i, stream_num, name_len, value_type, value_len, name);
value_num= avio_rl16(pb);//we should use get_value() here but it does not work 2 is le16 here but le32 elsewhere
url_fskip(pb, value_len - 2);
avio_seek(pb, value_len - 2, SEEK_CUR);
if(stream_num<128){
if (!strcmp(name, "AspectRatioX")) asf->dar[stream_num].num= value_num;
......@@ -571,7 +571,7 @@ static int asf_read_marker(AVFormatContext *s, int64_t size)
avio_rl32(pb); // flags
name_len = avio_rl32(pb); // name length
if ((ret = avio_get_str16le(pb, name_len * 2, name, sizeof(name))) < name_len)
url_fskip(pb, name_len - ret);
avio_seek(pb, name_len - ret, SEEK_CUR);
ff_new_chapter(s, i, (AVRational){1, 10000000}, pres_time, AV_NOPTS_VALUE, name );
}
......@@ -826,16 +826,16 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
// for(i=0; i<asf->packet_replic_size-8; i++)
// av_log(s, AV_LOG_DEBUG, "%02X ",avio_r8(pb));
// av_log(s, AV_LOG_DEBUG, "\n");
url_fskip(pb, 10);
avio_seek(pb, 10, SEEK_CUR);
ts0= avio_rl64(pb);
ts1= avio_rl64(pb);
url_fskip(pb, 12);
avio_seek(pb, 12, SEEK_CUR);
avio_rl32(pb);
url_fskip(pb, asf->packet_replic_size - 8 - 38 - 4);
avio_seek(pb, asf->packet_replic_size - 8 - 38 - 4, SEEK_CUR);
if(ts0!= -1) asf->packet_frag_timestamp= ts0/10000;
else asf->packet_frag_timestamp= AV_NOPTS_VALUE;
}else
url_fskip(pb, asf->packet_replic_size - 8);
avio_seek(pb, asf->packet_replic_size - 8, SEEK_CUR);
rsize += asf->packet_replic_size; // FIXME - check validity
} else if (asf->packet_replic_size==1){
// multipacket - frag_offset is beginning timestamp
......@@ -895,7 +895,7 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
//printf("PacketLeftSize:%d Pad:%d Pos:%"PRId64"\n", asf->packet_size_left, asf->packet_padsize, url_ftell(pb));
assert(ret>=0);
/* fail safe */
url_fskip(pb, ret);
avio_seek(pb, ret, SEEK_CUR);
asf->packet_pos= url_ftell(pb);
if (asf->data_object_size != (uint64_t)-1 &&
......@@ -914,7 +914,7 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
) {
asf->packet_time_start = 0;
/* unhandled packet (should not happen) */
url_fskip(pb, asf->packet_frag_size);
avio_seek(pb, asf->packet_frag_size, SEEK_CUR);
asf->packet_size_left -= asf->packet_frag_size;
if(asf->stream_index < 0)
av_log(s, AV_LOG_ERROR, "ff asf skip %d (unknown stream)\n", asf->packet_frag_size);
......@@ -934,7 +934,7 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
if (asf->packet_multi_size < asf->packet_obj_size)
{
asf->packet_time_start = 0;
url_fskip(pb, asf->packet_multi_size);
avio_seek(pb, asf->packet_multi_size, SEEK_CUR);
asf->packet_size_left -= asf->packet_multi_size;
continue;
}
......
......@@ -321,12 +321,12 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t end)
}
if (name)
av_metadata_set2(&s->metadata, name, buffer, 0);
url_fskip(s->pb, size);
avio_seek(s->pb, size, SEEK_CUR);
}
break;
}
default:
url_fskip(s->pb, size);
avio_seek(s->pb, size, SEEK_CUR);
break;
}
}
......@@ -392,13 +392,13 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
unsigned char date[64] = {0};
size += (size & 1);
size -= avio_read(pb, date, FFMIN(size, sizeof(date)-1));
url_fskip(pb, size);
avio_seek(pb, size, SEEK_CUR);
avi_metadata_creation_time(&s->metadata, date);
break;
}
case MKTAG('d', 'm', 'l', 'h'):
avi->is_odml = 1;
url_fskip(pb, size + (size & 1));
avio_seek(pb, size + (size & 1), SEEK_CUR);
break;
case MKTAG('a', 'm', 'v', 'h'):
amv_file_format=1;
......@@ -410,13 +410,13 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
avio_rl32(pb);
avi->non_interleaved |= avio_rl32(pb) & AVIF_MUSTUSEINDEX;
url_fskip(pb, 2 * 4);
avio_seek(pb, 2 * 4, SEEK_CUR);
avio_rl32(pb);
avio_rl32(pb);
avih_width=avio_rl32(pb);
avih_height=avio_rl32(pb);
url_fskip(pb, size - 10 * 4);
avio_seek(pb, size - 10 * 4, SEEK_CUR);
break;
case MKTAG('s', 't', 'r', 'h'):
/* stream header */
......@@ -425,7 +425,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
handler = avio_rl32(pb); /* codec tag */
if(tag1 == MKTAG('p', 'a', 'd', 's')){
url_fskip(pb, size - 8);
avio_seek(pb, size - 8, SEEK_CUR);
break;
}else{
stream_index++;
......@@ -469,10 +469,10 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
goto fail;
}
s->streams[0]->priv_data = ast;
url_fskip(pb, 3 * 4);
avio_seek(pb, 3 * 4, SEEK_CUR);
ast->scale = avio_rl32(pb);
ast->rate = avio_rl32(pb);
url_fskip(pb, 4); /* start time */
avio_seek(pb, 4, SEEK_CUR); /* start time */
dv_dur = avio_rl32(pb);
if (ast->scale > 0 && ast->rate > 0 && dv_dur > 0) {
......@@ -485,7 +485,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
*/
stream_index = s->nb_streams - 1;
url_fskip(pb, size - 9*4);
avio_seek(pb, size - 9*4, SEEK_CUR);
break;
}
......@@ -542,12 +542,12 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
if(ast->sample_size == 0)
st->duration = st->nb_frames;
ast->frame_offset= ast->cum_len;
url_fskip(pb, size - 12 * 4);
avio_seek(pb, size - 12 * 4, SEEK_CUR);
break;
case MKTAG('s', 't', 'r', 'f'):
/* stream header */
if (stream_index >= (unsigned)s->nb_streams || avi->dv_demux) {
url_fskip(pb, size);
avio_seek(pb, size, SEEK_CUR);
} else {
uint64_t cur_pos = url_ftell(pb);
if (cur_pos < list_end)
......@@ -560,7 +560,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->height=avih_height;
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_AMV;
url_fskip(pb, size);
avio_seek(pb, size, SEEK_CUR);
break;
}
tag1 = ff_get_bmp_header(pb, st);
......@@ -620,7 +620,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
st->codec->height= FFABS(st->codec->height);
// url_fskip(pb, size - 5 * 4);
// avio_seek(pb, size - 5 * 4, SEEK_CUR);
break;
case AVMEDIA_TYPE_AUDIO:
ff_get_wav_header(pb, st->codec, size);
......@@ -630,7 +630,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
ast->sample_size= st->codec->block_align;
}
if (size&1) /* 2-aligned (fix for Stargate SG-1 - 3x18 - Shades of Grey.avi) */
url_fskip(pb, 1);
avio_seek(pb, 1, SEEK_CUR);
/* Force parsing as several audio frames can be in
* one packet and timestamps refer to packet start. */
st->need_parsing = AVSTREAM_PARSE_TIMESTAMPS;
......@@ -658,7 +658,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->codec_type = AVMEDIA_TYPE_DATA;
st->codec->codec_id= CODEC_ID_NONE;
st->codec->codec_tag= 0;
url_fskip(pb, size);
avio_seek(pb, size, SEEK_CUR);
break;
}
}
......@@ -710,7 +710,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
/* skip tag */
size += (size & 1);
url_fskip(pb, size);
avio_seek(pb, size, SEEK_CUR);
break;
}
}
......@@ -762,7 +762,7 @@ static int read_gab2_sub(AVStream *st, AVPacket *pkt) {
goto error;
ret = avio_get_str16le(pb, desc_len, desc, sizeof(desc));
url_fskip(pb, desc_len - ret);
avio_seek(pb, desc_len - ret, SEEK_CUR);
if (*desc)
av_metadata_set2(&st->metadata, "title", desc, 0);
......@@ -1008,14 +1008,14 @@ resync:
//parse JUNK
||(d[0] == 'J' && d[1] == 'U' && d[2] == 'N' && d[3] == 'K')
||(d[0] == 'i' && d[1] == 'd' && d[2] == 'x' && d[3] == '1')){
url_fskip(pb, size);
avio_seek(pb, size, SEEK_CUR);
//av_log(s, AV_LOG_DEBUG, "SKIP\n");
goto resync;
}
//parse stray LIST
if(d[0] == 'L' && d[1] == 'I' && d[2] == 'S' && d[3] == 'T'){
url_fskip(pb, 4);
avio_seek(pb, 4, SEEK_CUR);
goto resync;
}
......@@ -1026,7 +1026,7 @@ resync:
//detect ##ix chunk and skip
if(d[2] == 'i' && d[3] == 'x' && n < s->nb_streams){
url_fskip(pb, size);
avio_seek(pb, size, SEEK_CUR);
goto resync;
}
......@@ -1060,7 +1060,7 @@ resync:
/*|| (st->discard >= AVDISCARD_NONKEY && !(pkt->flags & AV_PKT_FLAG_KEY))*/ //FIXME needs a little reordering
|| st->discard >= AVDISCARD_ALL){
ast->frame_offset += get_duration(ast, size);
url_fskip(pb, size);
avio_seek(pb, size, SEEK_CUR);
goto resync;
}
......
......@@ -444,9 +444,9 @@ static int avi_write_ix(AVFormatContext *s)
/* Updating one entry in the AVI OpenDML master index */
avio_seek(pb, avist->indexes.indx_start - 8, SEEK_SET);
ffio_wfourcc(pb, "indx"); /* enabling this entry */
url_fskip(pb, 8);
avio_seek(pb, 8, SEEK_CUR);
avio_wl32(pb, avi->riff_id); /* nEntriesInUse */
url_fskip(pb, 16*avi->riff_id);
avio_seek(pb, 16*avi->riff_id, SEEK_CUR);
avio_wl64(pb, ix); /* qwOffset */
avio_wl32(pb, pos - ix); /* dwSize */
avio_wl32(pb, avist->indexes.entry); /* dwDuration */
......@@ -603,7 +603,7 @@ static int avi_write_trailer(AVFormatContext *s)
file_size = url_ftell(pb);
avio_seek(pb, avi->odml_list - 8, SEEK_SET);
ffio_wfourcc(pb, "LIST"); /* Making this AVI OpenDML one */
url_fskip(pb, 16);
avio_seek(pb, 16, SEEK_CUR);
for (n=nb_frames=0;n<s->nb_streams;n++) {
AVCodecContext *stream = s->streams[n]->codec;
......
......@@ -61,7 +61,7 @@ static int avs_read_header(AVFormatContext * s, AVFormatParameters * ap)
s->ctx_flags |= AVFMTCTX_NOHEADER;
url_fskip(s->pb, 4);
avio_seek(s->pb, 4, SEEK_CUR);
avs->width = avio_rl16(s->pb);
avs->height = avio_rl16(s->pb);
avs->bits_per_sample = avio_rl16(s->pb);
......@@ -204,7 +204,7 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt)
break;
default:
url_fskip(s->pb, size - 4);
avio_seek(s->pb, size - 4, SEEK_CUR);
}
}
}
......
......@@ -65,19 +65,19 @@ static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap)
return AVERROR(ENOMEM);
/* Set the total number of frames. */
url_fskip(pb, 8);
avio_seek(pb, 8, SEEK_CUR);
chunk_header = avio_rl32(pb);
bfi->nframes = avio_rl32(pb);
avio_rl32(pb);
avio_rl32(pb);
avio_rl32(pb);
fps = avio_rl32(pb);
url_fskip(pb, 12);
avio_seek(pb, 12, SEEK_CUR);
vstream->codec->width = avio_rl32(pb);
vstream->codec->height = avio_rl32(pb);
/*Load the palette to extradata */
url_fskip(pb, 8);
avio_seek(pb, 8, SEEK_CUR);
vstream->codec->extradata = av_malloc(768);
vstream->codec->extradata_size = 768;
avio_read(pb, vstream->codec->extradata,
......
......@@ -98,7 +98,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
return AVERROR(EIO);
}
url_fskip(pb, 4);
avio_seek(pb, 4, SEEK_CUR);
vst->codec->width = avio_rl32(pb);
vst->codec->height = avio_rl32(pb);
......@@ -127,7 +127,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
}
if (bink->num_audio_tracks) {
url_fskip(pb, 4 * bink->num_audio_tracks);
avio_seek(pb, 4 * bink->num_audio_tracks, SEEK_CUR);
for (i = 0; i < bink->num_audio_tracks; i++) {
ast = av_new_stream(s, 1);
......@@ -169,7 +169,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
keyframe ? AVINDEX_KEYFRAME : 0);
}
url_fskip(pb, 4);
avio_seek(pb, 4, SEEK_CUR);
bink->current_track = -1;
return 0;
......
......@@ -122,7 +122,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR(ENOMEM);
c93->audio->codec->codec_type = AVMEDIA_TYPE_AUDIO;
}
url_fskip(pb, 26); /* VOC header */
avio_seek(pb, 26, SEEK_CUR); /* VOC header */
ret = voc_get_packet(s, pkt, c93->audio, datasize - 26);
if (ret > 0) {
pkt->stream_index = 1;
......
......@@ -114,22 +114,22 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size)
av_log(s, AV_LOG_ERROR, "invalid AAC magic cookie\n");
return AVERROR_INVALIDDATA;
}
url_fskip(pb, skip);
avio_seek(pb, skip, SEEK_CUR);
} else if (st->codec->codec_id == CODEC_ID_ALAC) {
#define ALAC_PREAMBLE 12
#define ALAC_HEADER 36
if (size < ALAC_PREAMBLE + ALAC_HEADER) {
av_log(s, AV_LOG_ERROR, "invalid ALAC magic cookie\n");
url_fskip(pb, size);
avio_seek(pb, size, SEEK_CUR);
return AVERROR_INVALIDDATA;
}
url_fskip(pb, ALAC_PREAMBLE);
avio_seek(pb, ALAC_PREAMBLE, SEEK_CUR);
st->codec->extradata = av_mallocz(ALAC_HEADER + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);
avio_read(pb, st->codec->extradata, ALAC_HEADER);
st->codec->extradata_size = ALAC_HEADER;
url_fskip(pb, size - ALAC_PREAMBLE - ALAC_HEADER);
avio_seek(pb, size - ALAC_PREAMBLE - ALAC_HEADER, SEEK_CUR);
} else {
st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
......@@ -201,7 +201,7 @@ static int read_header(AVFormatContext *s,
int found_data, ret;
int64_t size;
url_fskip(pb, 8); /* magic, version, file flags */
avio_seek(pb, 8, SEEK_CUR); /* magic, version, file flags */
/* audio description chunk */
if (avio_rb32(pb) != MKBETAG('d','e','s','c')) {
......@@ -233,11 +233,11 @@ static int read_header(AVFormatContext *s,
switch (tag) {
case MKBETAG('d','a','t','a'):
url_fskip(pb, 4); /* edit count */
avio_seek(pb, 4, SEEK_CUR); /* edit count */
caf->data_start = url_ftell(pb);
caf->data_size = size < 0 ? -1 : size - 4;
if (caf->data_size > 0 && !url_is_streamed(pb))
url_fskip(pb, caf->data_size);
avio_seek(pb, caf->data_size, SEEK_CUR);
found_data = 1;
break;
......@@ -265,7 +265,7 @@ static int read_header(AVFormatContext *s,
case MKBETAG('f','r','e','e'):
if (size < 0)
return AVERROR_INVALIDDATA;
url_fskip(pb, size);
avio_seek(pb, size, SEEK_CUR);
break;
}
}
......
......@@ -96,7 +96,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
c->has_sound = 1;
size = avio_rb32(pb);
c->vidpos = url_ftell(pb) + size;
url_fskip(pb, 16);
avio_seek(pb, 16, SEEK_CUR);
fsize = avio_rl32(pb);
ast = av_new_stream(s, 0);
......@@ -108,7 +108,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
tag = avio_rl32(pb);
fsize = avio_rl32(pb);
if(tag == MKTAG('d', 'a', 't', 'a')) break;
url_fskip(pb, fsize);
avio_seek(pb, fsize, SEEK_CUR);
}
c->bpc = (fsize + c->frames - 1) / c->frames;
if(ast->codec->block_align)
......
......@@ -62,7 +62,7 @@ static int cdata_read_header(AVFormatContext *s, AVFormatParameters *ap)
};
sample_rate = avio_rb16(pb);
url_fskip(pb, 12);
avio_seek(pb, 12, SEEK_CUR);
st = av_new_stream(s, 0);
if (!st)
......
......@@ -222,7 +222,7 @@ static int process_audio_header_eacs(AVFormatContext *s)
ea->bytes = avio_r8(pb); /* 1=8-bit, 2=16-bit */
ea->num_channels = avio_r8(pb);
compression_type = avio_r8(pb);
url_fskip(pb, 13);
avio_seek(pb, 13, SEEK_CUR);
switch (compression_type) {
case 0:
......@@ -261,7 +261,7 @@ static int process_video_header_mdec(AVFormatContext *s)
{
EaDemuxContext *ea = s->priv_data;
AVIOContext *pb = s->pb;
url_fskip(pb, 4);
avio_seek(pb, 4, SEEK_CUR);
ea->width = avio_rl16(pb);
ea->height = avio_rl16(pb);
ea->time_base = (AVRational){1,15};
......@@ -274,7 +274,7 @@ static int process_video_header_vp6(AVFormatContext *s)
EaDemuxContext *ea = s->priv_data;
AVIOContext *pb = s->pb;
url_fskip(pb, 16);
avio_seek(pb, 16, SEEK_CUR);
ea->time_base.den = avio_rl32(pb);
ea->time_base.num = avio_rl32(pb);
ea->video_codec = CODEC_ID_VP6;
......@@ -316,7 +316,7 @@ static int process_ea_header(AVFormatContext *s) {
case SHEN_TAG :
blockid = avio_rl32(pb);
if (blockid == GSTR_TAG) {
url_fskip(pb, 4);
avio_seek(pb, 4, SEEK_CUR);
} else if ((blockid & 0xFFFF)!=PT00_TAG) {
av_log (s, AV_LOG_ERROR, "unknown SCHl headerid\n");
return 0;
......@@ -474,19 +474,19 @@ static int ea_read_packet(AVFormatContext *s,
/* audio data */
case ISNh_TAG:
/* header chunk also contains data; skip over the header portion*/
url_fskip(pb, 32);
avio_seek(pb, 32, SEEK_CUR);
chunk_size -= 32;
case ISNd_TAG:
case SCDl_TAG:
case SNDC_TAG:
case SDEN_TAG:
if (!ea->audio_codec) {
url_fskip(pb, chunk_size);
avio_seek(pb, chunk_size, SEEK_CUR);
break;
} else if (ea->audio_codec == CODEC_ID_PCM_S16LE_PLANAR ||
ea->audio_codec == CODEC_ID_MP3) {
num_samples = avio_rl32(pb);
url_fskip(pb, 8);
avio_seek(pb, 8, SEEK_CUR);
chunk_size -= 12;
}
ret = av_get_packet(pb, pkt, chunk_size);
......
......@@ -187,7 +187,7 @@ static int64_t get_dts(AVFormatContext *s, int64_t pos)
int64_t dts;
ffm_seek1(s, pos);
url_fskip(pb, 4);
avio_seek(pb, 4, SEEK_CUR);
dts = avio_rb64(pb);
#ifdef DEBUG_SEEK
av_log(s, AV_LOG_DEBUG, "dts=%0.6f\n", dts / 1000000.0);
......
......@@ -59,7 +59,7 @@ static int read_header(AVFormatContext *s,
return AVERROR_INVALIDDATA;
}
url_fskip(pb, 2);
avio_seek(pb, 2, SEEK_CUR);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_RAWVIDEO;
st->codec->pix_fmt = PIX_FMT_RGBA;
......@@ -84,7 +84,7 @@ static int read_packet(AVFormatContext *s,
return AVERROR(EIO);
pkt->dts = url_ftell(s->pb) / (st->codec->width * (st->codec->height + film->leading) * 4);
pkt->size = av_get_packet(s->pb, pkt, st->codec->width * st->codec->height * 4);
url_fskip(s->pb, st->codec->width * film->leading * 4);
avio_seek(s->pb, st->codec->width * film->leading * 4, SEEK_CUR);
if (pkt->size < 0)
return pkt->size;
pkt->flags |= AV_PKT_FLAG_KEY;
......
......@@ -113,7 +113,7 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, int flv_co
static int amf_get_string(AVIOContext *ioc, char *buffer, int buffsize) {
int length = avio_rb16(ioc);
if(length >= buffsize) {
url_fskip(ioc, length);
avio_seek(ioc, length, SEEK_CUR);