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();
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;
}
}
/* Chunk is over */
if (size)
- url_fseek(pb, size, SEEK_CUR);
+ avio_seek(pb, size, SEEK_CUR);
return num_frames;
}
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;
}
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);
}
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;
/* 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;
}
/* 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);
/* 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);
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;
}
/* 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);
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))
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)) {
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;
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)
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;
}
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);
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;
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);
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,
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);
}
}
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)
// 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);
/* 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;
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) */
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);
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;
} 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);
}
/* 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);
}
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 */
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;
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){
}
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){
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);
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;
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;
}
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);
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;
}
/* 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;
}
}
/* do the seek */
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
avi->stream_index= -1;
return 0;
}
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);
}
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;
}
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 */
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;
}
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);
}
}
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);
}
*/
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);
/**
* @}
*/
* 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.
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;
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)
{
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)
* 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);
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)
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);
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;
}
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);
}
}
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;
}
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 */
/* 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;
}
return -1;
}
- url_fseek(s->pb, pos + caf->data_start, SEEK_SET);
+ avio_seek(s->pb, pos + caf->data_start, SEEK_SET);
return 0;
}
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;
}
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);
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;
}
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 */
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;
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)){
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;
}
case fVGT_TAG:
case MADm_TAG:
case MADe_TAG:
- url_fseek(pb, -8, SEEK_CUR); // include chunk preamble
+ avio_seek(pb, -8, SEEK_CUR); // include chunk preamble
chunk_size += 8;
goto get_video_packet;
case mTCD_TAG:
- url_fseek(pb, 8, SEEK_CUR); // skip ea dct header
+ avio_seek(pb, 8, SEEK_CUR); // skip ea dct header
chunk_size -= 8;
goto get_video_packet;
break;
default:
- url_fseek(pb, chunk_size, SEEK_CUR);
+ avio_seek(pb, chunk_size, SEEK_CUR);
break;
}
}
len = size;
if (len == 0) {
if (url_ftell(pb) == ffm->file_size)
- url_fseek(pb, ffm->packet_size, SEEK_SET);
+ avio_seek(pb, ffm->packet_size, SEEK_SET);
retry_read:
id = avio_rb16(pb); /* PACKET_ID */
if (id != PACKET_ID)
if (!frame_offset) {
/* This packet has no frame headers in it */
if (url_ftell(pb) >= ffm->packet_size * 3) {
- url_fseek(pb, -ffm->packet_size * 2, SEEK_CUR);
+ avio_seek(pb, -ffm->packet_size * 2, SEEK_CUR);
goto retry_read;
}
/* This is bad, we cannot find a valid frame header */
#ifdef DEBUG_SEEK
av_log(s, AV_LOG_DEBUG, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos);
#endif
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
}
static int64_t get_dts(AVFormatContext *s, int64_t pos)
//printf("pts range %0.6f - %0.6f\n", get_dts(s, 0) / 1000000. , get_dts(s, ffm->file_size - 2 * FFM_PACKET_SIZE) / 1000000. );
end:
- url_fseek(pb, ptr, SEEK_SET);
+ avio_seek(pb, ptr, SEEK_SET);
}
if (url_is_streamed(s->pb))
return AVERROR(EIO);
- url_fseek(pb, url_fsize(pb) - 36, SEEK_SET);
+ avio_seek(pb, url_fsize(pb) - 36, SEEK_SET);
if (avio_rb32(pb) != RAND_TAG) {
av_log(s, AV_LOG_ERROR, "magic number not found");
return AVERROR_INVALIDDATA;
film->leading = avio_rb16(pb);
av_set_pts_info(st, 64, 1, avio_rb16(pb));
- url_fseek(pb, 0, SEEK_SET);
+ avio_seek(pb, 0, SEEK_SET);
return 0;
}
static int read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
{
AVStream *st = s->streams[stream_index];
- url_fseek(s->pb, FFMAX(timestamp, 0) * st->codec->width * st->codec->height * 4, SEEK_SET);
+ avio_seek(s->pb, FFMAX(timestamp, 0) * st->codec->width * st->codec->height * 4, SEEK_SET);
return 0;
}
/* if fLaC marker is not found, assume there is no header */
if (avio_rl32(s->pb) != MKTAG('f','L','a','C')) {
- url_fseek(s->pb, -4, SEEK_CUR);
+ avio_seek(s->pb, -4, SEEK_CUR);
return 0;
}
break;
/* skip metadata block for unsupported types */
default:
- ret = url_fseek(s->pb, metadata_size, SEEK_CUR);
+ ret = avio_seek(s->pb, metadata_size, SEEK_CUR);
if (ret < 0)
return ret;
}
if (!url_is_streamed(pb)) {
/* rewrite the STREAMINFO header block data */
file_size = url_ftell(pb);
- url_fseek(pb, 8, SEEK_SET);
+ avio_seek(pb, 8, SEEK_SET);
avio_write(pb, streaminfo, FLAC_STREAMINFO_SIZE);
- url_fseek(pb, file_size, SEEK_SET);
+ avio_seek(pb, file_size, SEEK_SET);
put_flush_packet(pb);
} else {
av_log(s, AV_LOG_WARNING, "unable to rewrite FLAC header.\n");
return AVERROR(EIO);
}
- url_fseek(pb, -FLIC_PREAMBLE_SIZE, SEEK_CUR);
+ avio_seek(pb, -FLIC_PREAMBLE_SIZE, SEEK_CUR);
/* Time to figure out the framerate:
* If the first preamble's magic number is 0xAAAA then this file is from
av_set_pts_info(st, 64, FLIC_MC_SPEED, 70);
/* rewind the stream since the first chunk is at offset 12 */
- url_fseek(pb, 12, SEEK_SET);
+ avio_seek(pb, 12, SEEK_SET);
/* send over abbreviated FLIC header chunk */
av_free(st->codec->extradata);
}
/* skip useless 10B sub-header (yes, it's not accounted for in the chunk header) */
- url_fseek(pb, 10, SEEK_CUR);
+ avio_seek(pb, 10, SEEK_CUR);
pkt->stream_index = flic->audio_stream_index;
pkt->pos = url_ftell(pb);
packet_read = 1;
} else {
/* not interested in this chunk */
- url_fseek(pb, size - 6, SEEK_CUR);
+ avio_seek(pb, size - 6, SEEK_CUR);
}
}
}
offset = avio_rb32(s->pb);
- url_fseek(s->pb, offset, SEEK_SET);
+ avio_seek(s->pb, offset, SEEK_SET);
url_fskip(s->pb, 4);
s->start_time = 0;
else /* skip packet */
av_log(s, AV_LOG_DEBUG, "skipping flv packet: type %d, size %d, flags %d\n", type, size, flags);
skip:
- url_fseek(s->pb, next, SEEK_SET);
+ avio_seek(s->pb, next, SEEK_SET);
continue;
}
||(st->discard >= AVDISCARD_BIDIR && ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_DISP_INTER && !is_audio))
|| st->discard >= AVDISCARD_ALL
){
- url_fseek(s->pb, next, SEEK_SET);
+ avio_seek(s->pb, next, SEEK_SET);
continue;
}
if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY)
int size;
const int64_t pos= url_ftell(s->pb);
const int64_t fsize= url_fsize(s->pb);
- url_fseek(s->pb, fsize-4, SEEK_SET);
+ avio_seek(s->pb, fsize-4, SEEK_SET);
size= avio_rb32(s->pb);
- url_fseek(s->pb, fsize-3-size, SEEK_SET);
+ avio_seek(s->pb, fsize-3-size, SEEK_SET);
if(size == avio_rb24(s->pb) + 11){
uint32_t ts = avio_rb24(s->pb);
ts |= avio_r8(s->pb) << 24;
s->duration = ts * (int64_t)AV_TIME_BASE / 1000;
}
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
}
if(is_audio){
/* write total size of tag */
data_size= url_ftell(pb) - metadata_size_pos - 10;
- url_fseek(pb, metadata_size_pos, SEEK_SET);
+ avio_seek(pb, metadata_size_pos, SEEK_SET);
avio_wb24(pb, data_size);
- url_fseek(pb, data_size + 10 - 3, SEEK_CUR);
+ avio_seek(pb, data_size + 10 - 3, SEEK_CUR);
avio_wb32(pb, data_size + 11);
for (i = 0; i < s->nb_streams; i++) {
ff_isom_write_avcc(pb, enc->extradata, enc->extradata_size);
}
data_size = url_ftell(pb) - pos;
- url_fseek(pb, -data_size - 10, SEEK_CUR);
+ avio_seek(pb, -data_size - 10, SEEK_CUR);
avio_wb24(pb, data_size);
- url_fseek(pb, data_size + 10 - 3, SEEK_CUR);
+ avio_seek(pb, data_size + 10 - 3, SEEK_CUR);
avio_wb32(pb, data_size + 11); // previous tag size
}
}
file_size = url_ftell(pb);
/* update informations */
- url_fseek(pb, flv->duration_offset, SEEK_SET);
+ avio_seek(pb, flv->duration_offset, SEEK_SET);
put_amf_double(pb, flv->duration / (double)1000);
- url_fseek(pb, flv->filesize_offset, SEEK_SET);
+ avio_seek(pb, flv->filesize_offset, SEEK_SET);
put_amf_double(pb, file_size);
- url_fseek(pb, file_size, SEEK_SET);
+ avio_seek(pb, file_size, SEEK_SET);
return 0;
}
if (tmp != 1)
goto start;
last_pos = url_ftell(pb);
- if (url_fseek(pb, -5, SEEK_CUR) < 0)
+ if (avio_seek(pb, -5, SEEK_CUR) < 0)
goto out;
if (!parse_packet_header(pb, &type, &len) || type != PKT_MEDIA) {
- if (url_fseek(pb, last_pos, SEEK_SET) < 0)
+ if (avio_seek(pb, last_pos, SEEK_SET) < 0)
goto out;
goto start;
}
cur_timestamp = avio_rb32(pb);
last_found_pos = url_ftell(pb) - 16 - 6;
if ((track >= 0 && track != cur_track) || (timestamp >= 0 && timestamp > cur_timestamp)) {
- if (url_fseek(pb, last_pos, SEEK_SET) >= 0)
+ if (avio_seek(pb, last_pos, SEEK_SET) >= 0)
goto start;
}
out:
if (last_found_pos)
- url_fseek(pb, last_found_pos, SEEK_SET);
+ avio_seek(pb, last_found_pos, SEEK_SET);
return cur_timestamp;
}
if (idx < st->nb_index_entries - 2)
maxlen = st->index_entries[idx + 2].pos - pos;
maxlen = FFMAX(maxlen, 200 * 1024);
- res = url_fseek(s->pb, pos, SEEK_SET);
+ res = avio_seek(s->pb, pos, SEEK_SET);
if (res < 0)
return res;
found = gxf_resync_media(s, maxlen, -1, timestamp);
int64_t *pos, int64_t pos_limit) {
AVIOContext *pb = s->pb;
int64_t res;
- if (url_fseek(pb, *pos, SEEK_SET) < 0)
+ if (avio_seek(pb, *pos, SEEK_SET) < 0)
return AV_NOPTS_VALUE;
res = gxf_resync_media(s, pos_limit - *pos, -1, -1);
*pos = url_ftell(pb);
size = url_ftell(pb) - pos;
}
curpos = url_ftell(pb);
- url_fseek(pb, pos + 6, SEEK_SET);
+ avio_seek(pb, pos + 6, SEEK_SET);
avio_wb32(pb, size);
- url_fseek(pb, curpos, SEEK_SET);
+ avio_seek(pb, curpos, SEEK_SET);
return curpos - pos;
}
int64_t curpos;
curpos = url_ftell(pb);
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
avio_wb16(pb, curpos - pos - 2);
- url_fseek(pb, curpos, SEEK_SET);
+ avio_seek(pb, curpos, SEEK_SET);
return curpos - pos;
}
}
curpos = url_ftell(pb);
- url_fseek(pb, startpos, SEEK_SET);
+ avio_seek(pb, startpos, SEEK_SET);
avio_wl16(pb, curpos - startpos);
- url_fseek(pb, curpos, SEEK_SET);
+ avio_seek(pb, curpos, SEEK_SET);
}
return url_ftell(pb) - pos;
}
gxf_write_eos_packet(pb);
end = url_ftell(pb);
- url_fseek(pb, 0, SEEK_SET);
+ avio_seek(pb, 0, SEEK_SET);
/* overwrite map, flt and umf packets with new values */
gxf_write_map_packet(s, 1);
gxf_write_flt_packet(s);
put_flush_packet(pb);
/* update duration in all map packets */
for (i = 1; i < gxf->map_offsets_nb; i++) {
- url_fseek(pb, gxf->map_offsets[i], SEEK_SET);
+ avio_seek(pb, gxf->map_offsets[i], SEEK_SET);
gxf_write_map_packet(s, 1);
put_flush_packet(pb);
}
- url_fseek(pb, end, SEEK_SET);
+ avio_seek(pb, end, SEEK_SET);
av_freep(&gxf->flt_entries);
av_freep(&gxf->map_offsets);
/* XXX: change that */
filesize = url_fsize(s->pb);
if (filesize > 128) {
- url_fseek(s->pb, filesize - 128, SEEK_SET);
+ avio_seek(s->pb, filesize - 128, SEEK_SET);
ret = avio_read(s->pb, buf, ID3v1_TAG_SIZE);
if (ret == ID3v1_TAG_SIZE) {
parse_tag(s, buf);
}
- url_fseek(s->pb, 0, SEEK_SET);
+ avio_seek(s->pb, 0, SEEK_SET);
}
}
}
break;
}
/* Skip to end of tag */
- url_fseek(s->pb, next, SEEK_SET);
+ avio_seek(s->pb, next, SEEK_SET);
}
if (len > 0) {
(buf[9] & 0x7f);
ff_id3v2_parse(s, len, buf[3], buf[5]);
} else {
- url_fseek(s->pb, off, SEEK_SET);
+ avio_seek(s->pb, off, SEEK_SET);
}
} while (found_header);
ff_metadata_conv(&s->metadata, NULL, ff_id3v2_34_metadata_conv);
chunk_size = avio_rl32(pb);
/* skip the number of decoded bytes (always equal to width * height) */
- url_fseek(pb, 4, SEEK_CUR);
+ avio_seek(pb, 4, SEEK_CUR);
chunk_size -= 4;
ret= av_get_packet(pb, pkt, chunk_size);
if (ret < 0)
break;
}
/* don't care about this chunk anymore */
- url_fseek(pb, RoQ_CHUNK_PREAMBLE_SIZE, SEEK_CUR);
+ avio_seek(pb, RoQ_CHUNK_PREAMBLE_SIZE, SEEK_CUR);
break;
case RoQ_QUAD_CODEBOOK:
/* packet needs to contain both this codebook and next VQ chunk */
codebook_offset = url_ftell(pb) - RoQ_CHUNK_PREAMBLE_SIZE;
codebook_size = chunk_size;
- url_fseek(pb, codebook_size, SEEK_CUR);
+ avio_seek(pb, codebook_size, SEEK_CUR);
if (avio_read(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
RoQ_CHUNK_PREAMBLE_SIZE)
return AVERROR(EIO);
codebook_size;
/* rewind */
- url_fseek(pb, codebook_offset, SEEK_SET);
+ avio_seek(pb, codebook_offset, SEEK_SET);
/* load up the packet */
ret= av_get_packet(pb, pkt, chunk_size);
url_fskip(pb, data_size - (url_ftell(pb) - orig_pos) + (data_size & 1));
}
- url_fseek(pb, iff->body_pos, SEEK_SET);
+ avio_seek(pb, iff->body_pos, SEEK_SET);
switch(st->codec->codec_type) {
case AVMEDIA_TYPE_AUDIO:
s->audio_chunk_size -= 6;
}
- url_fseek(pb, s->audio_chunk_offset, SEEK_SET);
+ avio_seek(pb, s->audio_chunk_offset, SEEK_SET);
s->audio_chunk_offset = 0;
if (s->audio_chunk_size != av_get_packet(pb, pkt, s->audio_chunk_size))
return CHUNK_NOMEM;
pkt->pos= s->decode_map_chunk_offset;
- url_fseek(pb, s->decode_map_chunk_offset, SEEK_SET);
+ avio_seek(pb, s->decode_map_chunk_offset, SEEK_SET);
s->decode_map_chunk_offset = 0;
if (avio_read(pb, pkt->data, s->decode_map_chunk_size) !=
return CHUNK_EOF;
}
- url_fseek(pb, s->video_chunk_offset, SEEK_SET);
+ avio_seek(pb, s->video_chunk_offset, SEEK_SET);
s->video_chunk_offset = 0;
if (avio_read(pb, pkt->data + s->decode_map_chunk_size,
} else {
- url_fseek(pb, s->next_chunk_offset, SEEK_SET);
+ avio_seek(pb, s->next_chunk_offset, SEEK_SET);
chunk_type = CHUNK_DONE;
}
case OPCODE_END_OF_STREAM:
debug_ipmovie("end of stream\n");
- url_fseek(pb, opcode_size, SEEK_CUR);
+ avio_seek(pb, opcode_size, SEEK_CUR);
break;
case OPCODE_END_OF_CHUNK:
debug_ipmovie("end of chunk\n");
- url_fseek(pb, opcode_size, SEEK_CUR);
+ avio_seek(pb, opcode_size, SEEK_CUR);
break;
case OPCODE_CREATE_TIMER:
case OPCODE_START_STOP_AUDIO:
debug_ipmovie("start/stop audio\n");
- url_fseek(pb, opcode_size, SEEK_CUR);
+ avio_seek(pb, opcode_size, SEEK_CUR);
break;
case OPCODE_INIT_VIDEO_BUFFERS:
case OPCODE_UNKNOWN_14:
case OPCODE_UNKNOWN_15:
debug_ipmovie("unknown (but documented) opcode %02X\n", opcode_type);
- url_fseek(pb, opcode_size, SEEK_CUR);
+ avio_seek(pb, opcode_size, SEEK_CUR);
break;
case OPCODE_SEND_BUFFER:
debug_ipmovie("send buffer\n");
- url_fseek(pb, opcode_size, SEEK_CUR);
+ avio_seek(pb, opcode_size, SEEK_CUR);
break;
case OPCODE_AUDIO_FRAME:
/* log position and move on for now */
s->audio_chunk_offset = url_ftell(pb);
s->audio_chunk_size = opcode_size;
- url_fseek(pb, opcode_size, SEEK_CUR);
+ avio_seek(pb, opcode_size, SEEK_CUR);
break;
case OPCODE_SILENCE_FRAME:
debug_ipmovie("silence frame\n");
- url_fseek(pb, opcode_size, SEEK_CUR);
+ avio_seek(pb, opcode_size, SEEK_CUR);
break;
case OPCODE_INIT_VIDEO_MODE:
debug_ipmovie("initialize video mode\n");
- url_fseek(pb, opcode_size, SEEK_CUR);
+ avio_seek(pb, opcode_size, SEEK_CUR);
break;
case OPCODE_CREATE_GRADIENT:
debug_ipmovie("create gradient\n");
- url_fseek(pb, opcode_size, SEEK_CUR);
+ avio_seek(pb, opcode_size, SEEK_CUR);
break;
case OPCODE_SET_PALETTE:
case OPCODE_SET_PALETTE_COMPRESSED:
debug_ipmovie("set palette compressed\n");
- url_fseek(pb, opcode_size, SEEK_CUR);
+ avio_seek(pb, opcode_size, SEEK_CUR);
break;
case OPCODE_SET_DECODING_MAP:
/* log position and move on for now */
s->decode_map_chunk_offset = url_ftell(pb);
s->decode_map_chunk_size = opcode_size;
- url_fseek(pb, opcode_size, SEEK_CUR);
+ avio_seek(pb, opcode_size, SEEK_CUR);
break;
case OPCODE_VIDEO_DATA:
/* log position and move on for now */
s->video_chunk_offset = url_ftell(pb);
s->video_chunk_size = opcode_size;
- url_fseek(pb, opcode_size, SEEK_CUR);
+ avio_seek(pb, opcode_size, SEEK_CUR);
break;
default:
CHUNK_PREAMBLE_SIZE)
return AVERROR(EIO);
chunk_type = AV_RL16(&chunk_preamble[2]);
- url_fseek(pb, -CHUNK_PREAMBLE_SIZE, SEEK_CUR);
+ avio_seek(pb, -CHUNK_PREAMBLE_SIZE, SEEK_CUR);
if (chunk_type == CHUNK_VIDEO)
ipmovie->audio_type = CODEC_ID_NONE; /* no audio */
pos = url_fsize(bc) + pos;
whence = SEEK_SET;
}
- return url_fseek(bc, pos, whence);
+ return avio_seek(bc, pos, whence);
}
static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
return ebml_parse_nest(matroska, syntax->def.n, data);
case EBML_PASS: return ebml_parse_id(matroska, syntax->def.n, id, data);
case EBML_STOP: return 1;
- default: return url_fseek(pb,length,SEEK_CUR)<0 ? AVERROR(EIO) : 0;
+ default: return avio_seek(pb,length,SEEK_CUR)<0 ? AVERROR(EIO) : 0;
}
if (res == AVERROR_INVALIDDATA)
av_log(matroska->ctx, AV_LOG_ERROR, "Invalid element\n");
continue;
/* seek */
- if (url_fseek(matroska->ctx->pb, offset, SEEK_SET) != offset)
+ if (avio_seek(matroska->ctx->pb, offset, SEEK_SET) != offset)
continue;
/* We don't want to lose our seekhead level, so we add
}
/* seek back */
- url_fseek(matroska->ctx->pb, before_pos, SEEK_SET);
+ avio_seek(matroska->ctx->pb, before_pos, SEEK_SET);
matroska->level_up = level_up;
matroska->current_id = saved_id;
}
timestamp = FFMAX(timestamp, st->index_entries[0].timestamp);
if ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
- url_fseek(s->pb, st->index_entries[st->nb_index_entries-1].pos, SEEK_SET);
+ avio_seek(s->pb, st->index_entries[st->nb_index_entries-1].pos, SEEK_SET);
while ((index = av_index_search_timestamp(st, timestamp, flags)) < 0) {
matroska_clear_queue(matroska);
if (matroska_parse_cluster(matroska) < 0)
}
}
- url_fseek(s->pb, st->index_entries[index_min].pos, SEEK_SET);
+ avio_seek(s->pb, st->index_entries[index_min].pos, SEEK_SET);
matroska->skip_to_keyframe = !(flags & AVSEEK_FLAG_ANY);
matroska->skip_to_timecode = st->index_entries[index].timestamp;
matroska->done = 0;
{
int64_t pos = url_ftell(pb);
- if (url_fseek(pb, master.pos - master.sizebytes, SEEK_SET) < 0)
+ if (avio_seek(pb, master.pos - master.sizebytes, SEEK_SET) < 0)
return;
put_ebml_num(pb, pos - master.pos, master.sizebytes);
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
}
static void put_xiph_size(AVIOContext *pb, int size)
currentpos = url_ftell(pb);
if (seekhead->reserved_size > 0)
- if (url_fseek(pb, seekhead->filepos, SEEK_SET) < 0)
+ if (avio_seek(pb, seekhead->filepos, SEEK_SET) < 0)
return -1;
metaseek = start_ebml_master(pb, MATROSKA_ID_SEEKHEAD, seekhead->reserved_size);
if (seekhead->reserved_size > 0) {
uint64_t remaining = seekhead->filepos + seekhead->reserved_size - url_ftell(pb);
put_ebml_void(pb, remaining);
- url_fseek(pb, currentpos, SEEK_SET);
+ avio_seek(pb, currentpos, SEEK_SET);
currentpos = seekhead->filepos;
}
// update the duration
av_log(s, AV_LOG_DEBUG, "end duration = %" PRIu64 "\n", mkv->duration);
currentpos = url_ftell(pb);
- url_fseek(pb, mkv->duration_offset, SEEK_SET);
+ avio_seek(pb, mkv->duration_offset, SEEK_SET);
put_ebml_float(pb, MATROSKA_ID_DURATION, mkv->duration);
- url_fseek(pb, currentpos, SEEK_SET);
+ avio_seek(pb, currentpos, SEEK_SET);
}
end_ebml_master(pb, mkv->segment);
avio_rl16(pb); /* ibm-pc video bios mode */
width = avio_rl16(pb);
height = avio_rl16(pb);
- url_fseek(pb, length - 10, SEEK_CUR); /* unknown data */
+ avio_seek(pb, length - 10, SEEK_CUR); /* unknown data */
/* video stream */
st = av_new_stream(s, 0);
default :
av_log(s, AV_LOG_INFO, "unknown chunk type 0x%x\n", type);
- url_fseek(pb, length, SEEK_CUR);
+ avio_seek(pb, length, SEEK_CUR);
}
}
int64_t pos;
pos = url_ftell(pb);
- url_fseek(pb, start - 4, SEEK_SET);
+ avio_seek(pb, start - 4, SEEK_SET);
avio_wb32(pb, (uint32_t)(pos - start));
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
}
static int mmf_write_header(AVFormatContext *s)
size = pos - mmf->awapos;
/* Fill Atsq chunk */
- url_fseek(pb, mmf->atsqpos, SEEK_SET);
+ avio_seek(pb, mmf->atsqpos, SEEK_SET);
/* "play wav" */
avio_w8(pb, 0); /* start time */
/* "end of sequence" */
avio_write(pb, "\x00\x00\x00\x00", 4);
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
put_flush_packet(pb);
}
file_size = avio_rb32(pb);
/* Skip some unused chunks that may or may not be present */
- for(;; url_fseek(pb, size, SEEK_CUR)) {
+ for(;; avio_seek(pb, size, SEEK_CUR)) {
tag = avio_rl32(pb);
size = avio_rb32(pb);
if(tag == MKTAG('C','N','T','I')) continue;
avio_r8(pb); /* time base g */
/* Skip some unused chunks that may or may not be present */
- for(;; url_fseek(pb, size, SEEK_CUR)) {
+ for(;; avio_seek(pb, size, SEEK_CUR)) {
tag = avio_rl32(pb);
size = avio_rb32(pb);
if(tag == MKTAG('A','t','s','q')) continue;
url_fskip(pb, len);
}
}
- url_fseek(pb, next, SEEK_SET);
+ avio_seek(pb, next, SEEK_SET);
}
return 0;
}
uint32_t tag = avio_rl32(pb);
atom.size -= 4;
if (tag == MKTAG('h','d','l','r')) {
- url_fseek(pb, -8, SEEK_CUR);
+ avio_seek(pb, -8, SEEK_CUR);
atom.size += 8;
return mov_read_default(c, pb, atom);
}
uint16_t ch;
int len, title_len;
- if (url_fseek(sc->pb, sample->pos, SEEK_SET) != sample->pos) {
+ if (avio_seek(sc->pb, sample->pos, SEEK_SET) != sample->pos) {
av_log(s, AV_LOG_ERROR, "Chapter %d not found in file\n", i);
goto finish;
}
av_freep(&title);
}
finish:
- url_fseek(sc->pb, cur_pos, SEEK_SET);
+ avio_seek(sc->pb, cur_pos, SEEK_SET);
}
static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)
sc->current_sample++;
if (st->discard != AVDISCARD_ALL) {
- if (url_fseek(sc->pb, sample->pos, SEEK_SET) != sample->pos) {
+ if (avio_seek(sc->pb, sample->pos, SEEK_SET) != sample->pos) {
av_log(mov->fc, AV_LOG_ERROR, "stream %d, offset 0x%"PRIx64": partial file\n",
sc->ffindex, sample->pos);
return -1;
static int64_t updateSize(AVIOContext *pb, int64_t pos)
{
int64_t curpos = url_ftell(pb);
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
avio_wb32(pb, curpos - pos); /* rewrite size */
- url_fseek(pb, curpos, SEEK_SET);
+ avio_seek(pb, curpos, SEEK_SET);
return curpos - pos;
}
}
}
curpos = url_ftell(pb);
- url_fseek(pb, entryPos, SEEK_SET);
+ avio_seek(pb, entryPos, SEEK_SET);
avio_wb32(pb, index); // rewrite size
- url_fseek(pb, curpos, SEEK_SET);
+ avio_seek(pb, curpos, SEEK_SET);
return updateSize(pb, pos);
}
}
}
curpos = url_ftell(pb);
- url_fseek(pb, entryPos, SEEK_SET);
+ avio_seek(pb, entryPos, SEEK_SET);
avio_wb32(pb, index); // rewrite size
- url_fseek(pb, curpos, SEEK_SET);
+ avio_seek(pb, curpos, SEEK_SET);
return updateSize(pb, pos);
}
/* Write size of mdat tag */
if (mov->mdat_size+8 <= UINT32_MAX) {
- url_fseek(pb, mov->mdat_pos, SEEK_SET);
+ avio_seek(pb, mov->mdat_pos, SEEK_SET);
avio_wb32(pb, mov->mdat_size+8);
} else {
/* overwrite 'wide' placeholder atom */
- url_fseek(pb, mov->mdat_pos - 8, SEEK_SET);
+ avio_seek(pb, mov->mdat_pos - 8, SEEK_SET);
avio_wb32(pb, 1); /* special value: real atom size will be 64 bit value after tag field */
ffio_wfourcc(pb, "mdat");
avio_wb64(pb, mov->mdat_size+16);
}
- url_fseek(pb, moov_pos, SEEK_SET);
+ avio_seek(pb, moov_pos, SEEK_SET);
mov_write_moov_tag(pb, mov, s);
size -= packet_len;
curpos = url_ftell(out);
- url_fseek(out, entries_pos, SEEK_SET);
+ avio_seek(out, entries_pos, SEEK_SET);
avio_wb16(out, entries);
- url_fseek(out, curpos, SEEK_SET);
+ avio_seek(out, curpos, SEEK_SET);
}
curpos = url_ftell(out);
- url_fseek(out, count_pos, SEEK_SET);
+ avio_seek(out, count_pos, SEEK_SET);
avio_wb16(out, count);
- url_fseek(out, curpos, SEEK_SET);
+ avio_seek(out, curpos, SEEK_SET);
return count;
}
return -1;
/* Check for Xing / Info tag */
- url_fseek(s->pb, xing_offtbl[c.lsf == 1][c.nb_channels == 1], SEEK_CUR);
+ avio_seek(s->pb, xing_offtbl[c.lsf == 1][c.nb_channels == 1], SEEK_CUR);
v = avio_rb32(s->pb);
if(v == MKBETAG('X', 'i', 'n', 'g') || v == MKBETAG('I', 'n', 'f', 'o')) {
v = avio_rb32(s->pb);
}
/* Check for VBRI tag (always 32 bytes after end of mpegaudio header) */
- url_fseek(s->pb, base + 4 + 32, SEEK_SET);
+ avio_seek(s->pb, base + 4 + 32, SEEK_SET);
v = avio_rb32(s->pb);
if(v == MKBETAG('V', 'B', 'R', 'I')) {
/* Check tag version */
if(avio_rb16(s->pb) == 1) {
/* skip delay and quality */
- url_fseek(s->pb, 4, SEEK_CUR);
+ avio_seek(s->pb, 4, SEEK_CUR);
frames = avio_rb32(s->pb);
size = avio_rb32(s->pb);
}
return -1;
/* Skip the vbr tag frame */
- url_fseek(s->pb, base + vbrtag_size, SEEK_SET);
+ avio_seek(s->pb, base + vbrtag_size, SEEK_SET);
spf = c.lsf ? 576 : 1152; /* Samples per frame, layer 3 */
if(frames)
ff_id3v1_read(s);
if (mp3_parse_vbr_tags(s, st, off) < 0)
- url_fseek(s->pb, off, SEEK_SET);
+ avio_seek(s->pb, off, SEEK_SET);
/* the parameters will be extracted from the compressed bitstream */
return 0;
}
cur_pos = url_ftell(s->pb);
- url_fseek(s->pb, size_pos, SEEK_SET);
+ avio_seek(s->pb, size_pos, SEEK_SET);
id3v2_put_size(s, totlen);
- url_fseek(s->pb, cur_pos, SEEK_SET);
+ avio_seek(s->pb, cur_pos, SEEK_SET);
return 0;
}
ff_ape_parse_tag(s);
if (!av_metadata_get(s->metadata, "", NULL, AV_METADATA_IGNORE_SUFFIX))
ff_id3v1_read(s);
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
}
return 0;
return -1;
if(c->curframe != c->lastframe + 1){
- url_fseek(s->pb, c->frames[c->curframe].pos, SEEK_SET);
+ avio_seek(s->pb, c->frames[c->curframe].pos, SEEK_SET);
c->curbits = c->frames[c->curframe].skip;
}
c->lastframe = c->curframe;
size2 = (tmp >> (44 - curbits)) & 0xFFFFF;
}
curbits += 20;
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
size = ((size2 + curbits + 31) & ~31) >> 3;
if(cur == c->frames_noted){
pkt->pts = cur;
ret = avio_read(s->pb, pkt->data + 4, size);
if(c->curbits)
- url_fseek(s->pb, -4, SEEK_CUR);
+ avio_seek(s->pb, -4, SEEK_CUR);
if(ret < size){
av_free_packet(pkt);
return AVERROR(EIO);
int i, t, seekd;
GetBitContext gb;
- url_fseek(s->pb, off, SEEK_SET);
+ avio_seek(s->pb, off, SEEK_SET);
mpc8_get_chunk_header(s->pb, &tag, &size);
if(tag != TAG_SEEKTABLE){
av_log(s, AV_LOG_ERROR, "No seek table at given position\n");
pos = url_ftell(pb) + size;
off = ff_get_v(pb);
mpc8_parse_seektable(s, chunk_pos + off);
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
break;
default:
url_fskip(pb, size);
int index = av_index_search_timestamp(st, timestamp, flags);
if(index < 0) return -1;
- url_fseek(s->pb, st->index_entries[index].pos, SEEK_SET);
+ avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);
c->frame = st->index_entries[index].timestamp;
return 0;
}
pos = pos_start - 16386;
if (pos < 0)
pos = 0;
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
avio_r8(pb);
pos = pos_start;
start_code = -1;
goto the_end;
}
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
start_code = avio_rb32(pb);
if ((start_code & 0xffffff00) == 0x100)
break;
int64_t last_sync= url_ftell(s->pb);
error_redo:
- url_fseek(s->pb, last_sync, SEEK_SET);
+ avio_seek(s->pb, last_sync, SEEK_SET);
redo:
/* next start code (should be immediately after) */
m->header_state = 0xff;
static const unsigned char avs_seqh[4] = { 0, 0, 1, 0xb0 };
unsigned char buf[8];
avio_read(s->pb, buf, 8);
- url_fseek(s->pb, -8, SEEK_CUR);
+ avio_seek(s->pb, -8, SEEK_CUR);
if(!memcmp(buf, avs_seqh, 4) && (buf[6] != 0 || buf[7] != 1))
codec_id = CODEC_ID_CAVS;
else
#ifdef DEBUG_SEEK
printf("read_dts: pos=0x%"PRIx64" next=%d -> ", pos, find_next);
#endif
- if (url_fseek(s->pb, pos, SEEK_SET) < 0)
+ if (avio_seek(s->pb, pos, SEEK_SET) < 0)
return AV_NOPTS_VALUE;
for(;;) {
if (c < 0)
return -1;
if (c == 0x47) {
- url_fseek(pb, -1, SEEK_CUR);
+ avio_seek(pb, -1, SEEK_CUR);
return 0;
}
}
/* check paquet sync byte */
if (buf[0] != 0x47) {
/* find a new packet start */
- url_fseek(pb, -TS_PACKET_SIZE, SEEK_CUR);
+ avio_seek(pb, -TS_PACKET_SIZE, SEEK_CUR);
if (mpegts_resync(s) < 0)
return AVERROR(EAGAIN);
else
/* normal demux */
/* first do a scaning to get all the services */
- if (url_fseek(pb, pos, SEEK_SET) < 0)
+ if (avio_seek(pb, pos, SEEK_SET) < 0)
av_log(s, AV_LOG_ERROR, "Unable to seek back to the start\n");
mpegts_open_section_filter(ts, SDT_PID, sdt_cb, ts, 1);
#endif
}
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
return 0;
fail:
return -1;
/* we read the next PCR (XXX: optimize it by using a bigger buffer */
pos = url_ftell(s->pb);
for(i = 0; i < MAX_PACKET_READAHEAD; i++) {
- url_fseek(s->pb, pos + i * ts->raw_packet_size, SEEK_SET);
+ avio_seek(s->pb, pos + i * ts->raw_packet_size, SEEK_SET);
avio_read(s->pb, pcr_buf, 12);
if (parse_pcr(&next_pcr_h, &next_pcr_l, pcr_buf) == 0) {
/* XXX: not precise enough */
break;
}
}
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
/* no next PCR found: we use previous increment */
ts->cur_pcr = pcr_h * 300 + pcr_l;
}
pos = ((*ppos + ts->raw_packet_size - 1 - ts->pos47) / ts->raw_packet_size) * ts->raw_packet_size + ts->pos47;
if (find_next) {
for(;;) {
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
if (avio_read(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE)
return AV_NOPTS_VALUE;
if ((pcr_pid < 0 || (AV_RB16(buf + 1) & 0x1fff) == pcr_pid) &&
pos -= ts->raw_packet_size;
if (pos < 0)
return AV_NOPTS_VALUE;
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
if (avio_read(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE)
return AV_NOPTS_VALUE;
if ((pcr_pid < 0 || (AV_RB16(buf + 1) & 0x1fff) == pcr_pid) &&
pos= url_ftell(s->pb);
for(;;) {
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
if (avio_read(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE)
return -1;
// pid = AV_RB16(buf + 1) & 0x1fff;
if(buf[1] & 0x40) break;
pos += ts->raw_packet_size;
}
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
return 0;
}
// Jump over header
- if(url_fseek(pb, MTV_HEADER_SIZE, SEEK_SET) != MTV_HEADER_SIZE)
+ if(avio_seek(pb, MTV_HEADER_SIZE, SEEK_SET) != MTV_HEADER_SIZE)
return AVERROR(EIO);
return 0;
else if (read_child(ctx, pb, tag, size, uid) < 0)
return -1;
- url_fseek(pb, next, SEEK_SET);
+ avio_seek(pb, next, SEEK_SET);
}
if (ctx_size) ctx->type = type;
return ctx_size ? mxf_add_metadata_set(mxf, ctx) : 0;
av_log(s, AV_LOG_ERROR, "could not find header partition pack key\n");
return -1;
}
- url_fseek(s->pb, -14, SEEK_CUR);
+ avio_seek(s->pb, -14, SEEK_CUR);
mxf->fc = s;
while (!url_feof(s->pb)) {
const MXFMetadataReadTableEntry *metadata;
if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key) ||
IS_KLV_KEY(klv.key, mxf_essence_element_key)) {
/* FIXME avoid seek */
- url_fseek(s->pb, klv.offset, SEEK_SET);
+ avio_seek(s->pb, klv.offset, SEEK_SET);
break;
}
if (sample_time < 0)
sample_time = 0;
seconds = av_rescale(sample_time, st->time_base.num, st->time_base.den);
- url_fseek(s->pb, (s->bit_rate * seconds) >> 3, SEEK_SET);
+ avio_seek(s->pb, (s->bit_rate * seconds) >> 3, SEEK_SET);
av_update_cur_dts(s, st, sample_time);
return 0;
}
header_byte_count = pos - start + klv_fill_size(pos);
// update header_byte_count
- url_fseek(pb, header_byte_count_offset, SEEK_SET);
+ avio_seek(pb, header_byte_count_offset, SEEK_SET);
avio_wb64(pb, header_byte_count);
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
}
put_flush_packet(pb);
mxf_write_random_index_pack(s);
if (!url_is_streamed(s->pb)) {
- url_fseek(pb, 0, SEEK_SET);
+ avio_seek(pb, 0, SEEK_SET);
if (mxf->edit_unit_byte_count) {
mxf_write_partition(s, 1, 2, header_closed_partition_key, 1);
mxf_write_klv_fill(s);
av_dlog(s, "NSV [dataoffset][fileoffset]\n", table_entries);
for (i = 0; i < table_entries; i++) {
unsigned char b[8];
- url_fseek(pb, size + nsv->nsvs_file_offset[i], SEEK_SET);
+ avio_seek(pb, size + nsv->nsvs_file_offset[i], SEEK_SET);
avio_read(pb, b, 8);
av_dlog(s, "NSV [0x%08lx][0x%08lx]: %02x %02x %02x %02x %02x %02x %02x %02x"
"%c%c%c%c%c%c%c%c\n",
b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],
V(b[0]), V(b[1]), V(b[2]), V(b[3]), V(b[4]), V(b[5]), V(b[6]), V(b[7]) );
}
- //url_fseek(pb, size, SEEK_SET); /* go back to end of header */
+ //avio_seek(pb, size, SEEK_SET); /* go back to end of header */
#undef V
#endif
- url_fseek(pb, nsv->base_offset + size, SEEK_SET); /* required for dumbdriving-271.nsv (2 extra bytes) */
+ avio_seek(pb, nsv->base_offset + size, SEEK_SET); /* required for dumbdriving-271.nsv (2 extra bytes) */
if (url_feof(pb))
return -1;
if(index < 0)
return -1;
- url_fseek(s->pb, st->index_entries[index].pos, SEEK_SET);
+ avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);
nst->frame_offset = st->index_entries[index].timestamp;
nsv->state = NSV_UNSYNC;
return 0;
uint64_t state=0;
if(pos >= 0)
- url_fseek(bc, pos, SEEK_SET); //note, this may fail if the stream is not seekable, but that should not matter, as in this case we simply start where we currently are
+ avio_seek(bc, pos, SEEK_SET); //note, this may fail if the stream is not seekable, but that should not matter, as in this case we simply start where we currently are
while(!url_feof(bc)){
state= (state<<8) | avio_r8(bc);
static int skip_reserved(AVIOContext *bc, int64_t pos){
pos -= url_ftell(bc);
if(pos<0){
- url_fseek(bc, pos, SEEK_CUR);
+ avio_seek(bc, pos, SEEK_CUR);
return -1;
}else{
while(pos--)
int8_t *has_keyframe;
int ret= -1;
- url_fseek(bc, filesize-12, SEEK_SET);
- url_fseek(bc, filesize-avio_rb64(bc), SEEK_SET);
+ avio_seek(bc, filesize-12, SEEK_SET);
+ avio_seek(bc, filesize-avio_rb64(bc), SEEK_SET);
if(avio_rb64(bc) != INDEX_STARTCODE){
av_log(s, AV_LOG_ERROR, "no index at the end\n");
return -1;
if(!url_is_streamed(bc)){
int64_t orig_pos= url_ftell(bc);
find_and_decode_index(nut);
- url_fseek(bc, orig_pos, SEEK_SET);
+ avio_seek(bc, orig_pos, SEEK_SET);
}
assert(nut->next_startcode == SYNCPOINT_STARTCODE);
case STREAM_STARTCODE:
case INDEX_STARTCODE:
skip= get_packetheader(nut, bc, 0, tmp);
- url_fseek(bc, skip, SEEK_CUR);
+ avio_seek(bc, skip, SEEK_CUR);
break;
case INFO_STARTCODE:
if(decode_info_header(nut)<0)
}
av_log(NULL, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos2);
pos= find_startcode(s->pb, SYNCPOINT_STARTCODE, pos2);
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
av_log(NULL, AV_LOG_DEBUG, "SP: %"PRId64"\n", pos);
if(pos2 > pos || pos2 + 15 < pos){
av_log(NULL, AV_LOG_ERROR, "no syncpoint at backptr pos\n");
for (i = 0; i < ogg->nstreams; i++)
av_free (ogg->streams[i].buf);
- url_fseek (bc, ost->pos, SEEK_SET);
+ avio_seek (bc, ost->pos, SEEK_SET);
ogg->curidx = ost->curidx;
ogg->nstreams = ost->nstreams;
memcpy(ogg->streams, ost->streams,
end = size > MAX_PAGE_SIZE? size - MAX_PAGE_SIZE: 0;
ogg_save (s);
- url_fseek (s->pb, end, SEEK_SET);
+ avio_seek (s->pb, end, SEEK_SET);
while (!ogg_read_page (s, &i)){
if (ogg->streams[i].granule != -1 && ogg->streams[i].granule != 0 &&
AVIOContext *bc = s->pb;
int64_t pts = AV_NOPTS_VALUE;
int i;
- url_fseek(bc, *pos_arg, SEEK_SET);
+ avio_seek(bc, *pos_arg, SEEK_SET);
ogg_reset(ogg);
while (url_ftell(bc) < pos_limit && !ogg_packet(s, &i, NULL, NULL, pos_arg)) {
{
int64_t pos = url_ftell(pb);
uint32_t checksum = get_checksum(pb);
- url_fseek(pb, crc_offset, SEEK_SET);
+ avio_seek(pb, crc_offset, SEEK_SET);
avio_wb32(pb, checksum);
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
}
static int ogg_write_page(AVFormatContext *s, OGGPage *page, int extra_flags)
/* recompute exact position */
st->cur_dts = av_rescale(pos, st->time_base.den, byte_rate * (int64_t)st->time_base.num);
- if ((ret = url_fseek(s->pb, pos + s->data_offset, SEEK_SET)) < 0)
+ if ((ret = avio_seek(s->pb, pos + s->data_offset, SEEK_SET)) < 0)
return ret;
return 0;
}
else
start = 0;
- url_fseek(pb, start, SEEK_SET);
+ avio_seek(pb, start, SEEK_SET);
for(i=0; i<32; i++){
str->channels[i].video_stream_index=
while (*pos < pos_limit) {
res = AV_NOPTS_VALUE;
- url_fseek(pb, *pos, SEEK_SET);
+ avio_seek(pb, *pos, SEEK_SET);
pvactx->continue_pes = 0;
if (read_part_of_packet(s, &res, &length, &streamid, 0)) {
if (url_is_streamed(s->pb))
return 0;
// find REOB/REOF/REOS to load index
- url_fseek(s->pb, url_fsize(s->pb)-48-8, SEEK_SET);
+ avio_seek(s->pb, url_fsize(s->pb)-48-8, SEEK_SET);
if (read_atom(s, &atom) < 0)
av_log(s, AV_LOG_ERROR, "error reading end atom\n");
r3d_read_reos(s);
if (r3d->rdvo_offset) {
- url_fseek(s->pb, r3d->rdvo_offset, SEEK_SET);
+ avio_seek(s->pb, r3d->rdvo_offset, SEEK_SET);
if (read_atom(s, &atom) < 0)
av_log(s, AV_LOG_ERROR, "error reading 'rdvo' atom\n");
if (atom.tag == MKTAG('R','D','V','O')) {
}
out:
- url_fseek(s->pb, s->data_offset, SEEK_SET);
+ avio_seek(s->pb, s->data_offset, SEEK_SET);
return 0;
}
av_dlog(s, "seek frame num %d timestamp %lld\n", frame_num, sample_time);
if (frame_num < r3d->video_offsets_count) {
- url_fseek(s->pb, r3d->video_offsets_count, SEEK_SET);
+ avio_seek(s->pb, r3d->video_offsets_count, SEEK_SET);
} else {
av_log(s, AV_LOG_ERROR, "could not seek to frame %d\n", frame_num);
return -1;
size = avio_rb32(&pb);
} else {
size = rdt->mlti_data_size;
- url_fseek(&pb, 0, SEEK_SET);
+ avio_seek(&pb, 0, SEEK_SET);
}
if (ff_rm_read_mdpr_codecdata(rdt->rmctx, &pb, st, rdt->rmst[st->index], size) < 0)
return -1;
int64_t pos;
pos = url_ftell(pb);
- url_fseek(pb, start - 4, SEEK_SET);
+ avio_seek(pb, start - 4, SEEK_SET);
avio_wl32(pb, (uint32_t)(pos - start));
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
}
/* WAVEFORMATEX header */
++rl2->index_pos[stream_id];
/** position the stream (will probably be there anyway) */
- url_fseek(pb, sample->pos, SEEK_SET);
+ avio_seek(pb, sample->pos, SEEK_SET);
/** fill the packet */
ret = av_get_packet(pb, pkt, sample->size);
skip:
if (next_off && url_ftell(pb) != next_off &&
- url_fseek(pb, next_off, SEEK_SET) < 0)
+ avio_seek(pb, next_off, SEEK_SET) < 0)
return -1;
} while (next_off);
if (!data_off)
data_off = url_ftell(pb) - 18;
if (indx_off && !url_is_streamed(pb) && !(s->flags & AVFMT_FLAG_IGNIDX) &&
- url_fseek(pb, indx_off, SEEK_SET) >= 0) {
+ avio_seek(pb, indx_off, SEEK_SET) >= 0) {
rm_read_index(s);
- url_fseek(pb, data_off + 18, SEEK_SET);
+ avio_seek(pb, data_off + 18, SEEK_SET);
}
return 0;
if(rm->old_format)
return AV_NOPTS_VALUE;
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
rm->remaining_len=0;
for(;;){
int seq=1;
if (!url_is_streamed(s->pb)) {
/* end of file: finish to write header */
- index_pos = url_fseek(pb, 0, SEEK_CUR);
+ index_pos = avio_seek(pb, 0, SEEK_CUR);
data_size = index_pos - rm->data_pos;
/* FIXME: write index */
avio_wb32(pb, 0);
avio_wb32(pb, 0);
- url_fseek(pb, 0, SEEK_SET);
+ avio_seek(pb, 0, SEEK_SET);
for(i=0;i<s->nb_streams;i++)
rm->streams[i].total_frames = rm->streams[i].nb_frames;
rv10_write_header(s, data_size, 0);
error |= read_line(pb, line, sizeof(line)); // offset to key frame list
// Read the index
- url_fseek(pb, chunk_catalog_offset, SEEK_SET);
+ avio_seek(pb, chunk_catalog_offset, SEEK_SET);
total_audio_size = 0;
for (i = 0; i < number_of_chunks; i++) {
int64_t offset, video_size, audio_size;
index_entry = &stream->index_entries[rpl->chunk_number];
if (rpl->frame_in_part == 0)
- if (url_fseek(pb, index_entry->pos, SEEK_SET) < 0)
+ if (avio_seek(pb, index_entry->pos, SEEK_SET) < 0)
return AVERROR(EIO);
if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
frame_flags = avio_rl32(pb);
frame_size = avio_rl32(pb);
- if (url_fseek(pb, -8, SEEK_CUR) < 0)
+ if (avio_seek(pb, -8, SEEK_CUR) < 0)
return AVERROR(EIO);
ret = av_get_packet(pb, pkt, frame_size);
}
/* update file size */
- url_fseek(pb, 2, SEEK_SET);
+ avio_seek(pb, 2, SEEK_SET);
avio_wb16(pb, coded_file_size);
- url_fseek(pb, file_size, SEEK_SET);
+ avio_seek(pb, file_size, SEEK_SET);
put_flush_packet(pb);
skip_bits(&gb, 12); // reserved
data_len = get_bits(&gb, 16);
- url_fseek(&pb, pos + 4, SEEK_SET);
+ avio_seek(&pb, pos + 4, SEEK_SET);
tag = avio_rl32(&pb);
if ((st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
tag != MKTAG('v','i','d','e')) ||
/* 32-bit alignment */
url_fskip(&pb, ((url_ftell(&pb) + 3) & ~3) - url_ftell(&pb));
} else
- url_fseek(&pb, 4, SEEK_SET);
+ avio_seek(&pb, 4, SEEK_SET);
if (has_packet_info) {
av_log_missing_feature(s, "RTP-X-QT with packet specific info", 1);
int datatype, filetype, t1, t2, nb_comments, flags;
uint64_t start_pos = url_fsize(pb) - 128;
- url_fseek(pb, start_pos, SEEK_SET);
+ avio_seek(pb, start_pos, SEEK_SET);
if (avio_read(pb, buf, 7) != 7)
return -1;
if (memcmp(buf, "SAUCE00", 7))
*fsize -= 128;
if (nb_comments > 0) {
- url_fseek(pb, start_pos - 64*nb_comments - 5, SEEK_SET);
+ avio_seek(pb, start_pos - 64*nb_comments - 5, SEEK_SET);
if (avio_read(pb, buf, 5) == 5 && !memcmp(buf, "COMNT", 5)) {
int i;
char *str = av_malloc(65*nb_comments + 1);
step = s->pb->buffer_size;
curpos = FFMAX(pos - step / 2, 0);
for (;;) {
- url_fseek(s->pb, curpos, SEEK_SET);
+ avio_seek(s->pb, curpos, SEEK_SET);
search_hi_lo_keyframes(s,
ts, time_base,
flags,
}
}
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
av_free(sync);
return pos;
}
if (!state)
return;
- url_fseek(s->pb, state->fpos, SEEK_SET);
+ avio_seek(s->pb, state->fpos, SEEK_SET);
// copy context structures
s->cur_st = state->cur_st;
sample = &film->sample_table[film->current_sample];
/* position the stream (will probably be there anyway) */
- url_fseek(pb, sample->sample_offset, SEEK_SET);
+ avio_seek(pb, sample->sample_offset, SEEK_SET);
/* do a special song and dance when loading FILM Cinepak chunks */
if ((sample->stream == film->video_stream_index) &&
int sound_buffers;
/* fetch the main header, including the 2 header length bytes */
- url_fseek(pb, 0, SEEK_SET);
+ avio_seek(pb, 0, SEEK_SET);
if (avio_read(pb, vmd->vmd_header, VMD_HEADER_SIZE) != VMD_HEADER_SIZE)
return AVERROR(EIO);
toc_offset = AV_RL32(&vmd->vmd_header[812]);
vmd->frame_count = AV_RL16(&vmd->vmd_header[6]);
vmd->frames_per_block = AV_RL16(&vmd->vmd_header[18]);
- url_fseek(pb, toc_offset, SEEK_SET);
+ avio_seek(pb, toc_offset, SEEK_SET);
raw_frame_table = NULL;
vmd->frame_table = NULL;
frame = &vmd->frame_table[vmd->current_frame];
/* position the stream (will probably be there already) */
- url_fseek(pb, frame->frame_offset, SEEK_SET);
+ avio_seek(pb, frame->frame_offset, SEEK_SET);
if (av_new_packet(pkt, frame->frame_size + BYTES_PER_FRAME_RECORD))
return AVERROR(ENOMEM);
/* if we demuxed all streams, pass another frame */
if(smk->curstream < 0) {
- url_fseek(s->pb, smk->nextpos, 0);
+ avio_seek(s->pb, smk->nextpos, 0);
frame_size = smk->frm_size[smk->cur_frame] & (~3);
flags = smk->frm_flags[smk->cur_frame];
/* handle palette change event */
sz++;
}
}
- url_fseek(s->pb, pos, 0);
+ avio_seek(s->pb, pos, 0);
palchange |= 1;
}
flags >>= 1;
/* update number of samples */
int64_t file_size = url_ftell(pb);
int64_t num_samples = (file_size - sox->header_size - 4LL) >> 2LL;
- url_fseek(pb, 8, SEEK_SET);
+ avio_seek(pb, 8, SEEK_SET);
if (enc->codec_id == CODEC_ID_PCM_S32LE) {
avio_wl64(pb, num_samples);
} else
avio_wb64(pb, num_samples);
- url_fseek(pb, file_size, SEEK_SET);
+ avio_seek(pb, file_size, SEEK_SET);
put_flush_packet(pb);
}
pos = url_ftell(pb);
tag_len = pos - swf->tag_pos - 2;
tag = swf->tag;
- url_fseek(pb, swf->tag_pos, SEEK_SET);
+ avio_seek(pb, swf->tag_pos, SEEK_SET);
if (tag & TAG_LONG) {
tag &= ~TAG_LONG;
avio_wl16(pb, (tag << 6) | 0x3f);
assert(tag_len < 0x3f);
avio_wl16(pb, (tag << 6) | tag_len);
}
- url_fseek(pb, pos, SEEK_SET);
+ avio_seek(pb, pos, SEEK_SET);
}
static inline void max_nbits(int *nbits_ptr, int val)
/* patch file size and number of frames if not streamed */
if (!url_is_streamed(s->pb) && video_enc) {
file_size = url_ftell(pb);
- url_fseek(pb, 4, SEEK_SET);
+ avio_seek(pb, 4, SEEK_SET);
avio_wl32(pb, file_size);
- url_fseek(pb, swf->duration_pos, SEEK_SET);
+ avio_seek(pb, swf->duration_pos, SEEK_SET);
avio_wl16(pb, swf->video_frame_number);
- url_fseek(pb, swf->vframes_pos, SEEK_SET);
+ avio_seek(pb, swf->vframes_pos, SEEK_SET);
avio_wl16(pb, swf->video_frame_number);
- url_fseek(pb, file_size, SEEK_SET);
+ avio_seek(pb, file_size, SEEK_SET);
}
return 0;
}
thp->next_frame = thp->first_frame;
/* Read the component structure. */
- url_fseek (pb, thp->compoff, SEEK_SET);
+ avio_seek (pb, thp->compoff, SEEK_SET);
thp->compcount = avio_rb32(pb);
/* Read the list of component types. */
if (thp->frame >= thp->framecnt)
return AVERROR(EIO);
- url_fseek(pb, thp->next_frame, SEEK_SET);
+ avio_seek(pb, thp->next_frame, SEEK_SET);
/* Locate the next frame and read out its size. */
thp->next_frame += thp->next_framesz;
int i, sz;
TiertexSeqFrameBuffer *seq_buffer;
- url_fseek(pb, 256, SEEK_SET);
+ avio_seek(pb, 256, SEEK_SET);
for (i = 0; i < SEQ_NUM_FRAME_BUFFERS; i++) {
sz = avio_rl16(pb);
if (seq_buffer->fill_size + data_size > seq_buffer->data_size || data_size <= 0)
return AVERROR_INVALIDDATA;
- url_fseek(pb, seq->current_frame_offs + data_offs, SEEK_SET);
+ avio_seek(pb, seq->current_frame_offs + data_offs, SEEK_SET);
if (avio_read(pb, seq_buffer->data + seq_buffer->fill_size, data_size) != data_size)
return AVERROR(EIO);
int i, e, err;
seq->current_frame_offs += SEQ_FRAME_SIZE;
- url_fseek(pb, seq->current_frame_offs, SEEK_SET);
+ avio_seek(pb, seq->current_frame_offs, SEEK_SET);
/* sound data */
seq->current_audio_data_offs = avio_rl16(pb);
pkt->data[0] = 0;
if (seq->current_pal_data_size) {
pkt->data[0] |= 1;
- url_fseek(pb, seq->current_frame_offs + seq->current_pal_data_offs, SEEK_SET);
+ avio_seek(pb, seq->current_frame_offs + seq->current_pal_data_offs, SEEK_SET);
if (avio_read(pb, &pkt->data[1], seq->current_pal_data_size) != seq->current_pal_data_size)
return AVERROR(EIO);
}
if (seq->current_audio_data_offs == 0) /* end of data reached */
return AVERROR(EIO);
- url_fseek(pb, seq->current_frame_offs + seq->current_audio_data_offs, SEEK_SET);
+ avio_seek(pb, seq->current_frame_offs + seq->current_audio_data_offs, SEEK_SET);
rc = av_get_packet(pb, pkt, seq->current_audio_data_size);
if (rc < 0)
return rc;
pos = timestamp *
(tmv->audio_chunk_size + tmv->video_chunk_size + tmv->padding);
- url_fseek(s->pb, pos + TMV_HEADER_SIZE, SEEK_SET);
+ avio_seek(s->pb, pos + TMV_HEADER_SIZE, SEEK_SET);
tmv->stream_index = 0;
return 0;
}
return -1;
}
st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE);
- url_fseek(s->pb, start_offset, SEEK_SET);
+ avio_seek(s->pb, start_offset, SEEK_SET);
avio_read(s->pb, st->codec->extradata, st->codec->extradata_size);
return 0;
return -1;
c->currentframe = index;
- url_fseek(s->pb, st->index_entries[index].pos, SEEK_SET);
+ avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);
return 0;
}
char buf[37];
int len;
- url_fseek(pb, start_pos, SEEK_SET);
+ avio_seek(pb, start_pos, SEEK_SET);
if (avio_r8(pb) != 0x1A)
return -1;
if (ff_sauce_read(avctx, &s->fsize, 0, 0) < 0)
efi_read(avctx, s->fsize - 51);
- url_fseek(avctx->pb, 0, SEEK_SET);
+ avio_seek(avctx->pb, 0, SEEK_SET);
}
return 0;
return -1;
/* do the seek */
- if ((ret = url_fseek(s->pb, pos, SEEK_SET)) < 0)
+ if ((ret = avio_seek(s->pb, pos, SEEK_SET)) < 0)
return ret;
av_update_cur_dts(s, st, ts);
if (pos < pos_min) pos= pos_min;
else if(pos > pos_max) pos= pos_max;
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
#if 0
av_update_cur_dts(s, st, ts);
if(st->nb_index_entries){
assert(st->index_entries);
ie= &st->index_entries[st->nb_index_entries-1];
- if ((ret = url_fseek(s->pb, ie->pos, SEEK_SET)) < 0)
+ if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0)
return ret;
av_update_cur_dts(s, st, ie->timestamp);
}else{
- if ((ret = url_fseek(s->pb, s->data_offset, SEEK_SET)) < 0)
+ if ((ret = avio_seek(s->pb, s->data_offset, SEEK_SET)) < 0)
return ret;
}
for(i=0;; i++) {
return 0;
}
ie = &st->index_entries[index];
- if ((ret = url_fseek(s->pb, ie->pos, SEEK_SET)) < 0)
+ if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0)
return ret;
av_update_cur_dts(s, st, ie->timestamp);
if (offset < 0)
offset = 0;
- url_fseek(ic->pb, offset, SEEK_SET);
+ avio_seek(ic->pb, offset, SEEK_SET);
read_size = 0;
for(;;) {
if (read_size >= DURATION_MAX_READ_SIZE<<(FFMAX(retry-1,0)))
fill_all_stream_timings(ic);
- url_fseek(ic->pb, old_offset, SEEK_SET);
+ avio_seek(ic->pb, old_offset, SEEK_SET);
for (i=0; i<ic->nb_streams; i++) {
st= ic->streams[i];
st->cur_dts= st->first_dts;
AVIOContext *pb = s->pb;
if (!url_is_streamed(s->pb)) {
- url_fseek(pb, 0, SEEK_SET);
+ avio_seek(pb, 0, SEEK_SET);
avio_wl24(pb, ctx->frames);
put_flush_packet(pb);
}
st->cur_dts = av_rescale(pos, st->time_base.den,
st->codec->bit_rate * (int64_t)st->time_base.num);
- if ((ret = url_fseek(s->pb, ((pos-7) >> 3) + s->data_offset, SEEK_SET)) < 0)
+ if ((ret = avio_seek(s->pb, ((pos-7) >> 3) + s->data_offset, SEEK_SET)) < 0)
return ret;
c->remaining_bits = -7 - ((pos-7)&7);
/* update file size */
file_size = url_ftell(pb);
- url_fseek(pb, 4, SEEK_SET);
+ avio_seek(pb, 4, SEEK_SET);
avio_wl32(pb, (uint32_t)(file_size - 8));
- url_fseek(pb, file_size, SEEK_SET);
+ avio_seek(pb, file_size, SEEK_SET);
put_flush_packet(pb);
number_of_samples = av_rescale(wav->maxpts - wav->minpts + wav->last_duration,
s->streams[0]->codec->sample_rate * (int64_t)s->streams[0]->time_base.num,
s->streams[0]->time_base.den);
- url_fseek(pb, wav->data-12, SEEK_SET);
+ avio_seek(pb, wav->data-12, SEEK_SET);
avio_wl32(pb, number_of_samples);
- url_fseek(pb, file_size, SEEK_SET);
+ avio_seek(pb, file_size, SEEK_SET);
put_flush_packet(pb);
}
}
size = next_tag(pb, &tag);
if (tag == tag1)
break;
- url_fseek(pb, size, SEEK_CUR);
+ avio_seek(pb, size, SEEK_CUR);
}
return size;
}
sample_count = avio_rl32(pb);
size -= 4;
}
- url_fseek(pb, size, SEEK_CUR);
+ avio_seek(pb, size, SEEK_CUR);
}
if (rf64)
size = data_size;
wc3->vpkt.data = NULL; wc3->vpkt.size = 0;
/* skip the first 3 32-bit numbers */
- url_fseek(pb, 12, SEEK_CUR);
+ avio_seek(pb, 12, SEEK_CUR);
/* traverse through the chunks and load the header information before
* the first BRCH tag */
case SOND_TAG:
case INDX_TAG:
/* SOND unknown, INDX unnecessary; ignore both */
- url_fseek(pb, size, SEEK_CUR);
+ avio_seek(pb, size, SEEK_CUR);
break;
case PC__TAG:
/* number of palettes, unneeded */
- url_fseek(pb, 12, SEEK_CUR);
+ avio_seek(pb, 12, SEEK_CUR);
break;
case BNAM_TAG:
case PALT_TAG:
/* one of several palettes */
- url_fseek(pb, -8, SEEK_CUR);
+ avio_seek(pb, -8, SEEK_CUR);
av_append_packet(pb, &wc3->vpkt, 8 + PALETTE_SIZE);
break;
case SHOT_TAG:
/* load up new palette */
- url_fseek(pb, -8, SEEK_CUR);
+ avio_seek(pb, -8, SEEK_CUR);
av_append_packet(pb, &wc3->vpkt, 8 + 4);
break;
case VGA__TAG:
/* send out video chunk */
- url_fseek(pb, -8, SEEK_CUR);
+ avio_seek(pb, -8, SEEK_CUR);
ret= av_append_packet(pb, &wc3->vpkt, 8 + size);
// ignore error if we have some data
if (wc3->vpkt.size > 0)
case TEXT_TAG:
/* subtitle chunk */
#if 0
- url_fseek(pb, size, SEEK_CUR);
+ avio_seek(pb, size, SEEK_CUR);
#else
if ((unsigned)size > sizeof(text) || (ret = avio_read(pb, text, size)) != size)
ret = AVERROR(EIO);
st->codec->codec_tag = 0; /* no fourcc */
/* skip to the start of the VQA header */
- url_fseek(pb, 20, SEEK_SET);
+ avio_seek(pb, 20, SEEK_SET);
/* the VQA header needs to go to the decoder */
st->codec->extradata_size = VQA_HEADER_SIZE;
break;
}
- url_fseek(pb, chunk_size, SEEK_CUR);
+ avio_seek(pb, chunk_size, SEEK_CUR);
} while (chunk_tag != FINF_TAG);
return 0;
}
/* stay on 16-bit alignment */
if (skip_byte)
- url_fseek(pb, 1, SEEK_CUR);
+ avio_seek(pb, 1, SEEK_CUR);
return ret;
} else {
default:
av_log(s, AV_LOG_INFO, "Skipping unknown chunk 0x%08X\n", chunk_type);
}
- url_fseek(pb, chunk_size + skip_byte, SEEK_CUR);
+ avio_seek(pb, chunk_size + skip_byte, SEEK_CUR);
}
}
int i = wf->position >> wf->sector_bits;
if (i >= wf->nb_sectors ||
(wf->sectors[i] != wf->sectors[i - 1] + (1 << (wf->sector_bits - WTV_SECTOR_BITS)) &&
- url_fseek(pb, (int64_t)wf->sectors[i] << WTV_SECTOR_BITS, SEEK_SET) < 0)) {
+ avio_seek(pb, (int64_t)wf->sectors[i] << WTV_SECTOR_BITS, SEEK_SET) < 0)) {
wf->error = 1;
break;
}
offset = wf->length;
wf->error = offset < 0 || offset >= wf->length ||
- url_fseek(pb, ((int64_t)wf->sectors[offset >> wf->sector_bits] << WTV_SECTOR_BITS)
+ avio_seek(pb, ((int64_t)wf->sectors[offset >> wf->sector_bits] << WTV_SECTOR_BITS)
+ (offset & ((1 << wf->sector_bits) - 1)), SEEK_SET) < 0;
wf->position = offset;
return offset;
WtvFile *wf;
uint8_t *buffer;
- if (url_fseek(s->pb, first_sector << WTV_SECTOR_BITS, SEEK_SET) < 0)
+ if (avio_seek(s->pb, first_sector << WTV_SECTOR_BITS, SEEK_SET) < 0)
return NULL;
wf = av_mallocz(sizeof(WtvFile));
}
wf->nb_sectors = 0;
for (i = 0; i < nb_sectors1; i++) {
- if (url_fseek(s->pb, (int64_t)sectors1[i] << WTV_SECTOR_BITS, SEEK_SET) < 0)
+ if (avio_seek(s->pb, (int64_t)sectors1[i] << WTV_SECTOR_BITS, SEEK_SET) < 0)
break;
wf->nb_sectors += read_ints(s->pb, wf->sectors + i * WTV_SECTOR_SIZE / 4, WTV_SECTOR_SIZE / 4);
}
/* seek to intial sector */
wf->position = 0;
- if (url_fseek(s->pb, (int64_t)wf->sectors[0] << WTV_SECTOR_BITS, SEEK_SET) < 0) {
+ if (avio_seek(s->pb, (int64_t)wf->sectors[0] << WTV_SECTOR_BITS, SEEK_SET) < 0) {
av_free(wf->sectors);
av_free(wf);
return NULL;
st->codec->extradata_size = filesize;
avio_read(pb, st->codec->extradata, filesize);
done:
- url_fseek(pb, pos + length, SEEK_SET);
+ avio_seek(pb, pos + length, SEEK_SET);
}
static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int type, int length)
url_fskip(pb, size - 32);
ff_get_guid(pb, &actual_subtype);
ff_get_guid(pb, &actual_formattype);
- url_fseek(pb, -size, SEEK_CUR);
+ avio_seek(pb, -size, SEEK_CUR);
st = parse_media_type(s, st, sid, mediatype, actual_subtype, actual_formattype, size - 32);
url_fskip(pb, 32);
url_fskip(s->pb, 4);
root_sector = avio_rl32(s->pb);
- url_fseek(s->pb, root_sector << WTV_SECTOR_BITS, SEEK_SET);
+ avio_seek(s->pb, root_sector << WTV_SECTOR_BITS, SEEK_SET);
root_size = avio_read(s->pb, root, root_size);
if (root_size < 0)
return AVERROR_INVALIDDATA;
ret = parse_chunks(s, SEEK_TO_DATA, 0, 0);
if (ret < 0)
return ret;
- url_fseek(wtv->pb, -32, SEEK_CUR);
+ avio_seek(wtv->pb, -32, SEEK_CUR);
timeline_pos = url_ftell(s->pb); // save before opening another file
}
}
- url_fseek(s->pb, timeline_pos, SEEK_SET);
+ avio_seek(s->pb, timeline_pos, SEEK_SET);
return 0;
}
i = ff_index_search_timestamp(wtv->index_entries, wtv->nb_index_entries, ts_relative, flags);
if (i < 0) {
if (wtv->last_valid_pts == AV_NOPTS_VALUE || ts < wtv->last_valid_pts)
- url_fseek(pb, 0, SEEK_SET);
+ avio_seek(pb, 0, SEEK_SET);
else if (st->duration != AV_NOPTS_VALUE && ts_relative > st->duration && wtv->nb_index_entries)
- url_fseek(pb, wtv->index_entries[wtv->nb_index_entries - 1].pos, SEEK_SET);
+ avio_seek(pb, wtv->index_entries[wtv->nb_index_entries - 1].pos, SEEK_SET);
if (parse_chunks(s, SEEK_TO_PTS, ts, 0) < 0)
return AVERROR(ERANGE);
return 0;
if (wtv->epoch != AV_NOPTS_VALUE)
wtv->pts += wtv->epoch;
wtv->last_valid_pts = wtv->pts;
- url_fseek(pb, wtv->index_entries[i].pos, SEEK_SET);
+ avio_seek(pb, wtv->index_entries[i].pos, SEEK_SET);
return 0;
}
av_log(ctx, AV_LOG_ERROR, "Cannot determine custom sampling rate\n");
return -1;
}
- url_fseek(pb, block_end - wc->blksize + 24, SEEK_SET);
+ avio_seek(pb, block_end - wc->blksize + 24, SEEK_SET);
}
if(!wc->bpp) wc->bpp = bpp;
if(!wc->chan) wc->chan = chan;
ff_ape_parse_tag(s);
if(!av_metadata_get(s->metadata, "", NULL, AV_METADATA_IGNORE_SUFFIX))
ff_id3v1_read(s);
- url_fseek(s->pb, cur, SEEK_SET);
+ avio_seek(s->pb, cur, SEEK_SET);
}
return 0;
/* if found, seek there */
if (index >= 0){
wc->block_parsed = 1;
- url_fseek(s->pb, st->index_entries[index].pos, SEEK_SET);
+ avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);
return 0;
}
/* if timestamp is out of bounds, return error */
do{
ret = av_read_frame(s, pkt);
if (ret < 0){
- url_fseek(s->pb, pos, SEEK_SET);
+ avio_seek(s->pb, pos, SEEK_SET);
return -1;
}
pts = pkt->pts;
return AVERROR_INVALIDDATA;
}
- url_fseek(pb, 2048, SEEK_SET);
+ avio_seek(pb, 2048, SEEK_SET);
av_set_pts_info(video_stream, 32, 1, frame_rate);
frame_pos = timestamp * yop->frame_size + pos_min;
yop->odd_frame = timestamp & 1;
- url_fseek(s->pb, frame_pos, SEEK_SET);
+ avio_seek(s->pb, frame_pos, SEEK_SET);
return 0;
}