replace calls to url_feof() with avio_feof()

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
James Almer 2014-08-07 17:12:41 -03:00 committed by Michael Niedermayer
parent 5c3c67126f
commit d34ec64a22
96 changed files with 160 additions and 160 deletions

View File

@ -2824,7 +2824,7 @@ static int read_thread(void *arg)
av_freep(&opts);
if (ic->pb)
ic->pb->eof_reached = 0; // FIXME hack, ffplay maybe should not use url_feof() to test for the end
ic->pb->eof_reached = 0; // FIXME hack, ffplay maybe should not use avio_feof() to test for the end
if (seek_by_bytes < 0)
seek_by_bytes = !!(ic->iformat->flags & AVFMT_TS_DISCONT) && strcmp("ogg", ic->iformat->name);
@ -3013,7 +3013,7 @@ static int read_thread(void *arg)
}
ret = av_read_frame(ic, pkt);
if (ret < 0) {
if (ret == AVERROR_EOF || url_feof(ic->pb))
if (ret == AVERROR_EOF || avio_feof(ic->pb))
eof = 1;
if (ic->pb && ic->pb->error)
break;

View File

@ -293,7 +293,7 @@ static int fourxm_read_packet(AVFormatContext *s,
return ret;
fourcc_tag = AV_RL32(&header[0]);
size = AV_RL32(&header[4]);
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR(EIO);
switch (fourcc_tag) {
case LIST_TAG:

View File

@ -71,7 +71,7 @@ static int adp_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret, size = 1024;
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR_EOF;
ret = av_get_packet(s->pb, pkt, size);

View File

@ -58,7 +58,7 @@ static int get_tag(AVIOContext *pb, uint32_t * tag)
{
int size;
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR(EIO);
*tag = avio_rl32(pb);

View File

@ -117,7 +117,7 @@ static int amr_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t pos = avio_tell(s->pb);
AMRContext *amr = s->priv_data;
if (url_feof(s->pb)) {
if (avio_feof(s->pb)) {
return AVERROR(EIO);
}

View File

@ -175,7 +175,7 @@ static int read_packet(AVFormatContext *s,
Page *p;
int tmp, record_size;
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR(EIO);
if (anm->page < 0)

View File

@ -389,7 +389,7 @@ static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
APEContext *ape = s->priv_data;
uint32_t extra_size = 8;
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR_EOF;
if (ape->currentframe >= ape->totalframes)
return AVERROR_EOF;

View File

@ -61,7 +61,7 @@ static int aqt_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codec->codec_id = AV_CODEC_ID_TEXT;
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
char line[4096];
int len = ff_get_line(s->pb, line, sizeof(line));

View File

@ -785,7 +785,7 @@ static int asf_read_header(AVFormatContext *s)
continue;
} else if (!ff_guidcmp(&g, &ff_asf_marker_header)) {
asf_read_marker(s, gsize);
} else if (url_feof(pb)) {
} else if (avio_feof(pb)) {
return AVERROR_EOF;
} else {
if (!s->keylen) {
@ -822,7 +822,7 @@ static int asf_read_header(AVFormatContext *s)
avio_rl64(pb);
avio_r8(pb);
avio_r8(pb);
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
asf->data_offset = avio_tell(pb);
asf->packet_size_left = 0;
@ -922,20 +922,20 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb)
* the stream. */
if (pb->error == AVERROR(EAGAIN))
return AVERROR(EAGAIN);
if (!url_feof(pb))
if (!avio_feof(pb))
av_log(s, AV_LOG_ERROR,
"ff asf bad header %x at:%"PRId64"\n", c, avio_tell(pb));
}
if ((c & 0x8f) == 0x82) {
if (d || e) {
if (!url_feof(pb))
if (!avio_feof(pb))
av_log(s, AV_LOG_ERROR, "ff asf bad non zero\n");
return AVERROR_INVALIDDATA;
}
c = avio_r8(pb);
d = avio_r8(pb);
rsize += 3;
} else if(!url_feof(pb)) {
} else if(!avio_feof(pb)) {
avio_seek(pb, -1, SEEK_CUR); // FIXME
}
@ -1126,7 +1126,7 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
ASFStream *asf_st = 0;
for (;;) {
int ret;
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
if (asf->packet_size_left < FRAME_HEADER_SIZE ||
asf->packet_segments < 1 && asf->packet_time_start == 0) {
@ -1494,7 +1494,7 @@ static int asf_build_simple_index(AVFormatContext *s, int stream_index)
* skip them until the simple index object is reached */
while (ff_guidcmp(&g, &ff_asf_simple_index_header)) {
int64_t gsize = avio_rl64(s->pb);
if (gsize < 24 || url_feof(s->pb)) {
if (gsize < 24 || avio_feof(s->pb)) {
goto end;
}
avio_skip(s->pb, gsize - 24);
@ -1532,7 +1532,7 @@ static int asf_build_simple_index(AVFormatContext *s, int stream_index)
asf->index_read = ict > 1;
}
end:
// if (url_feof(s->pb)) {
// if (avio_feof(s->pb)) {
// ret = 0;
// }
avio_seek(s->pb, current_pos, SEEK_SET);

View File

@ -84,7 +84,7 @@ static int ast_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t pos;
int ret;
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR_EOF;
pos = avio_tell(s->pb);

View File

@ -219,7 +219,7 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num)
#ifdef DEBUG_SEEK
av_log(s, AV_LOG_ERROR, "pos:%"PRId64", len:%X\n", pos, len);
#endif
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_INVALIDDATA;
if (last_pos == pos || pos == base - 8)
@ -237,7 +237,7 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num)
avio_rl32(pb); /* size */
duration = avio_rl32(pb);
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_INVALIDDATA;
pos = avio_tell(pb);
@ -492,7 +492,7 @@ static int avi_read_header(AVFormatContext *s)
codec_type = -1;
frame_period = 0;
for (;;) {
if (url_feof(pb))
if (avio_feof(pb))
goto fail;
tag = avio_rl32(pb);
size = avio_rl32(pb);
@ -1111,7 +1111,7 @@ static int avi_sync(AVFormatContext *s, int exit_early)
start_sync:
memset(d, -1, sizeof(d));
for (i = sync = avio_tell(pb); !url_feof(pb); i++) {
for (i = sync = avio_tell(pb); !avio_feof(pb); i++) {
int j;
for (j = 0; j < 7; j++)
@ -1506,7 +1506,7 @@ static int avi_read_idx1(AVFormatContext *s, int size)
/* Read the entries and sort them in each stream component. */
for (i = 0; i < nb_index_entries; i++) {
if (url_feof(pb))
if (avio_feof(pb))
return -1;
tag = avio_rl32(pb);
@ -1662,7 +1662,7 @@ static int avi_load_index(AVFormatContext *s)
for (;;) {
tag = avio_rl32(pb);
size = avio_rl32(pb);
if (url_feof(pb))
if (avio_feof(pb))
break;
next = avio_tell(pb) + size + (size & 1);

View File

@ -213,7 +213,7 @@ static int vid_read_packet(AVFormatContext *s,
int audio_length;
int ret_value;
if(vid->is_finished || url_feof(pb))
if(vid->is_finished || avio_feof(pb))
return AVERROR_EOF;
block_type = avio_r8(pb);

View File

@ -116,7 +116,7 @@ static int bfi_read_packet(AVFormatContext * s, AVPacket * pkt)
BFIContext *bfi = s->priv_data;
AVIOContext *pb = s->pb;
int ret, audio_offset, video_offset, chunk_size, audio_size = 0;
if (bfi->nframes == 0 || url_feof(pb)) {
if (bfi->nframes == 0 || avio_feof(pb)) {
return AVERROR_EOF;
}
@ -124,7 +124,7 @@ static int bfi_read_packet(AVFormatContext * s, AVPacket * pkt)
if (!bfi->avflag) {
uint32_t state = 0;
while(state != MKTAG('S','A','V','I')){
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR(EIO);
state = 256*state + avio_r8(pb);
}

View File

@ -310,7 +310,7 @@ static int read_packet(AVFormatContext *s,
return AVERROR(EIO);
bin->fsize = -1; /* done */
} else if (!bin->fsize) {
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR(EIO);
if (av_get_packet(s->pb, pkt, bin->chars_per_frame) < 0)
return AVERROR(EIO);

View File

@ -76,7 +76,7 @@ static int read_packet(AVFormatContext *s,
int i, j, ret;
int64_t pos= avio_tell(pb);
if(url_feof(pb))
if(avio_feof(pb))
return AVERROR_EOF;
avio_rl16(pb); // sync word

View File

@ -181,7 +181,7 @@ static int read_header(AVFormatContext *s)
}
avio_skip(s->pb, size - (avio_tell(s->pb) - pos));
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
chunk = avio_rl32(s->pb);
size = avio_rb32(s->pb);
if (size < 8) {
@ -244,7 +244,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
uint32_t samples, size;
int ret;
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR_EOF;
b->current_block++;
if (b->current_block == b->block_count) {

View File

@ -241,7 +241,7 @@ static int read_header(AVFormatContext *s)
/* parse each chunk */
found_data = 0;
while (!url_feof(pb)) {
while (!avio_feof(pb)) {
/* stop at data chunk if seeking is not supported or
data chunk size is unknown */
@ -251,7 +251,7 @@ static int read_header(AVFormatContext *s)
tag = avio_rb32(pb);
size = avio_rb64(pb);
pos = avio_tell(pb);
if (url_feof(pb))
if (avio_feof(pb))
break;
switch (tag) {
@ -339,7 +339,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
int res, pkt_size = 0, pkt_frames = 0;
int64_t left = CAF_MAX_PKT_SIZE;
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
/* don't read past end of data chunk */

View File

@ -110,7 +110,7 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t pos;
int ret;
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
pos = avio_tell(pb);

View File

@ -41,7 +41,7 @@ static int daud_header(AVFormatContext *s) {
static int daud_packet(AVFormatContext *s, AVPacket *pkt) {
AVIOContext *pb = s->pb;
int ret, size;
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR(EIO);
size = avio_rb16(pb);
avio_rb16(pb); // unknown

View File

@ -150,7 +150,7 @@ static int cin_read_frame_header(CinDemuxContext *cin, AVIOContext *pb) {
hdr->video_frame_size = avio_rl32(pb);
hdr->audio_frame_size = avio_rl32(pb);
if (url_feof(pb) || pb->error)
if (avio_feof(pb) || pb->error)
return AVERROR(EIO);
if (avio_rl32(pb) != 0xAA55AA55)

View File

@ -64,7 +64,7 @@ static int dtshd_read_header(AVFormatContext *s)
st->codec->codec_id = AV_CODEC_ID_DTS;
st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
while (!url_feof(pb)) {
while (!avio_feof(pb)) {
chunk_type = avio_rb64(pb);
chunk_size = avio_rb64(pb);

View File

@ -504,7 +504,7 @@ static int dv_read_header(AVFormatContext *s)
state = avio_rb32(s->pb);
while ((state & 0xffffff7f) != 0x1f07003f) {
if (url_feof(s->pb)) {
if (avio_feof(s->pb)) {
av_log(s, AV_LOG_ERROR, "Cannot find DV header.\n");
return -1;
}

View File

@ -112,7 +112,7 @@ static int dxa_read_header(AVFormatContext *s)
if (ast->codec->sample_rate > 0)
avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
// find 'data' chunk
while(avio_tell(pb) < c->vidpos && !url_feof(pb)){
while(avio_tell(pb) < c->vidpos && !avio_feof(pb)){
tag = avio_rl32(pb);
fsize = avio_rl32(pb);
if(tag == MKTAG('d', 'a', 't', 'a')) break;
@ -170,7 +170,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
avio_seek(s->pb, c->vidpos, SEEK_SET);
while(!url_feof(s->pb) && c->frames){
while(!avio_feof(s->pb) && c->frames){
if ((ret = avio_read(s->pb, buf, 4)) != 4) {
av_log(s, AV_LOG_ERROR, "failed reading chunk type\n");
return ret < 0 ? ret : AVERROR_INVALIDDATA;

View File

@ -109,7 +109,7 @@ static int process_audio_header_elements(AVFormatContext *s)
ea->sample_rate = -1;
ea->num_channels = 1;
while (!url_feof(pb) && in_header) {
while (!avio_feof(pb) && in_header) {
int in_subheader;
uint8_t byte;
byte = avio_r8(pb);
@ -118,7 +118,7 @@ static int process_audio_header_elements(AVFormatContext *s)
case 0xFD:
av_log(s, AV_LOG_DEBUG, "entered audio subheader\n");
in_subheader = 1;
while (!url_feof(pb) && in_subheader) {
while (!avio_feof(pb) && in_subheader) {
uint8_t subbyte;
subbyte = avio_r8(pb);

View File

@ -63,7 +63,7 @@ static int ffm_resync(AVFormatContext *s, int state)
{
av_log(s, AV_LOG_ERROR, "resyncing\n");
while (state != PACKET_ID) {
if (url_feof(s->pb)) {
if (avio_feof(s->pb)) {
av_log(s, AV_LOG_ERROR, "cannot find FFM syncword\n");
return -1;
}
@ -250,7 +250,7 @@ static int ffm2_read_header(AVFormatContext *s)
ffm->file_size = (UINT64_C(1) << 63) - 1;
}
while(!url_feof(pb)) {
while(!avio_feof(pb)) {
unsigned id = avio_rb32(pb);
unsigned size = avio_rb32(pb);
int64_t next = avio_tell(pb) + size;

View File

@ -50,7 +50,7 @@ static void get_line(AVIOContext *s, uint8_t *buf, int size)
buf[i++] = c;
}
buf[i] = 0;
} while (!url_feof(s) && (buf[0] == ';' || buf[0] == '#' || buf[0] == 0));
} while (!avio_feof(s) && (buf[0] == ';' || buf[0] == '#' || buf[0] == 0));
}
static AVChapter *read_chapter(AVFormatContext *s)
@ -128,7 +128,7 @@ static int read_header(AVFormatContext *s)
AVDictionary **m = &s->metadata;
uint8_t line[1024];
while(!url_feof(s->pb)) {
while(!avio_feof(s->pb)) {
get_line(s->pb, line, sizeof(line));
if (!memcmp(line, ID_STREAM, strlen(ID_STREAM))) {

View File

@ -80,7 +80,7 @@ static int read_packet(AVFormatContext *s,
FilmstripDemuxContext *film = s->priv_data;
AVStream *st = s->streams[0];
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR(EIO);
pkt->dts = avio_tell(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);

View File

@ -49,7 +49,7 @@ static int flac_read_header(AVFormatContext *s)
}
/* process metadata blocks */
while (!url_feof(s->pb) && !metadata_last) {
while (!avio_feof(s->pb) && !metadata_last) {
avio_read(s->pb, header, 4);
flac_parse_block_header(header, &metadata_last, &metadata_type,
&metadata_size);

View File

@ -779,7 +779,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
dts = avio_rb24(s->pb);
dts |= avio_r8(s->pb) << 24;
av_dlog(s, "type:%d, size:%d, dts:%"PRId64" pos:%"PRId64"\n", type, size, dts, avio_tell(s->pb));
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR_EOF;
avio_skip(s->pb, 3); /* stream id, always 0 */
flags = 0;

View File

@ -84,7 +84,7 @@ static int resync(AVIOContext *pb)
int b = avio_r8(pb);
if (b != gif87a_sig[i] && b != gif89a_sig[i])
i = -(b != 'G');
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
}
return 0;
@ -234,7 +234,7 @@ parse_keyframe:
ret = AVERROR_EOF;
}
while (GIF_TRAILER != (block_label = avio_r8(pb)) && !url_feof(pb)) {
while (GIF_TRAILER != (block_label = avio_r8(pb)) && !avio_feof(pb)) {
if (block_label == GIF_EXTENSION_INTRODUCER) {
if ((ret = gif_read_ext (s)) < 0 )
goto resync;
@ -299,7 +299,7 @@ resync:
if ((ret >= 0 && !frame_parsed) || ret == AVERROR_EOF) {
/* This might happen when there is no image block
* between extension blocks and GIF_TRAILER or EOF */
if (!gdc->ignore_loop && (block_label == GIF_TRAILER || url_feof(pb))
if (!gdc->ignore_loop && (block_label == GIF_TRAILER || avio_feof(pb))
&& (gdc->total_iter < 0 || ++gdc->iter_count < gdc->total_iter))
return avio_seek(pb, 0, SEEK_SET);
return AVERROR_EOF;

View File

@ -442,7 +442,7 @@ static int gxf_header(AVFormatContext *s) {
#define READ_ONE() \
{ \
if (!max_interval-- || url_feof(pb)) \
if (!max_interval-- || avio_feof(pb)) \
goto out; \
tmp = tmp << 8 | avio_r8(pb); \
}
@ -504,7 +504,7 @@ static int gxf_packet(AVFormatContext *s, AVPacket *pkt) {
int field_nr, field_info, skip = 0;
int stream_index;
if (!parse_packet_header(pb, &pkt_type, &pkt_len)) {
if (!url_feof(pb))
if (!avio_feof(pb))
av_log(s, AV_LOG_ERROR, "sync lost\n");
return -1;
}

View File

@ -541,7 +541,7 @@ static int parse_playlist(HLSContext *c, const char *url,
pls->finished = 0;
pls->type = PLS_TYPE_UNSPECIFIED;
}
while (!url_feof(in)) {
while (!avio_feof(in)) {
read_chomp_line(in, line, sizeof(line));
if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
is_variant = 1;
@ -1532,7 +1532,7 @@ static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
AVRational tb;
ret = av_read_frame(pls->ctx, &pls->pkt);
if (ret < 0) {
if (!url_feof(&pls->pb) && ret != AVERROR_EOF)
if (!avio_feof(&pls->pb) && ret != AVERROR_EOF)
return ret;
reset_packet(&pls->pkt);
break;

View File

@ -126,7 +126,7 @@ static int parse_playlist(URLContext *h, const char *url)
free_segment_list(s);
s->finished = 0;
while (!url_feof(in)) {
while (!avio_feof(in)) {
read_chomp_line(in, line, sizeof(line));
if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
struct variant_info info = {{0}};

View File

@ -262,7 +262,7 @@ static int idcin_read_packet(AVFormatContext *s,
unsigned char palette_buffer[768];
uint32_t palette[256];
if (url_feof(s->pb))
if (avio_feof(s->pb))
return s->pb->error ? s->pb->error : AVERROR_EOF;
if (idcin->next_chunk_is_video) {

View File

@ -106,7 +106,7 @@ static int roq_read_packet(AVFormatContext *s,
while (!packet_read) {
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR(EIO);
/* get the next chunk preamble */

View File

@ -363,7 +363,7 @@ static int iff_read_header(AVFormatContext *s)
iff->maud_bits = -1;
iff->maud_compression = -1;
while(!url_feof(pb)) {
while(!avio_feof(pb)) {
uint64_t orig_pos;
int res;
const char *metadata_tag = NULL;

View File

@ -419,7 +419,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
infer_size(&codec->width, &codec->height, size[0]);
} else {
f[0] = s1->pb;
if (url_feof(f[0]))
if (avio_feof(f[0]))
return AVERROR(EIO);
if (s->frame_size > 0) {
size[0] = s->frame_size;

View File

@ -237,7 +237,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
return chunk_type;
/* read the next chunk, wherever the file happens to be pointing */
if (url_feof(pb))
if (avio_feof(pb))
return CHUNK_EOF;
if (avio_read(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
CHUNK_PREAMBLE_SIZE)
@ -283,7 +283,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
while ((chunk_size > 0) && (chunk_type != CHUNK_BAD)) {
/* read the next chunk, wherever the file happens to be pointing */
if (url_feof(pb)) {
if (avio_feof(pb)) {
chunk_type = CHUNK_EOF;
break;
}
@ -555,7 +555,7 @@ static int ipmovie_read_header(AVFormatContext *s)
while (memcmp(signature_buffer, signature, sizeof(signature))) {
memmove(signature_buffer, signature_buffer + 1, sizeof(signature_buffer) - 1);
signature_buffer[sizeof(signature_buffer) - 1] = avio_r8(pb);
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
}
/* initialize private context members */

View File

@ -174,7 +174,7 @@ static int jacosub_read_header(AVFormatContext *s)
av_bprint_init(&header, 1024+FF_INPUT_BUFFER_PADDING_SIZE, 4096);
while (!url_feof(pb)) {
while (!avio_feof(pb)) {
int cmd_len;
const char *p = line;
int64_t pos = avio_tell(pb);

View File

@ -166,7 +166,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
AVIOContext *pb = s->pb;
AVStream *ast = s->streams[0];
while (!url_feof(s->pb) && jv->pts < ast->nb_index_entries) {
while (!avio_feof(s->pb) && jv->pts < ast->nb_index_entries) {
const AVIndexEntry *e = ast->index_entries + jv->pts;
const JVFrame *jvf = jv->frames + jv->pts;

View File

@ -104,7 +104,7 @@ static int64_t read_line(AVBPrint *buf, AVIOContext *pb)
int64_t pos = avio_tell(pb);
av_bprint_clear(buf);
while(!url_feof(pb)) {
while(!avio_feof(pb)) {
int c = avio_r8(pb);
if(c != '\r') {
av_bprint_chars(buf, c, 1);
@ -169,7 +169,7 @@ static int lrc_read_header(AVFormatContext *s)
st->codec->codec_id = AV_CODEC_ID_TEXT;
av_bprint_init(&line, 0, AV_BPRINT_SIZE_UNLIMITED);
while(!url_feof(s->pb)) {
while(!avio_feof(s->pb)) {
int64_t pos = read_line(&line, s->pb);
int64_t header_offset = find_header(line.str);
if(header_offset >= 0) {

View File

@ -51,7 +51,7 @@ static int lvf_read_header(AVFormatContext *s)
avio_skip(s->pb, 1012);
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
id = avio_rl32(s->pb);
size = avio_rl32(s->pb);
next_offset = avio_tell(s->pb) + size;
@ -108,7 +108,7 @@ static int lvf_read_packet(AVFormatContext *s, AVPacket *pkt)
int ret, is_video = 0;
pos = avio_tell(s->pb);
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
id = avio_rl32(s->pb);
size = avio_rl32(s->pb);

View File

@ -92,7 +92,7 @@ static int sync(AVFormatContext *s, uint8_t *header)
return ret < 0 ? ret : AVERROR_EOF;
while (memcmp(buf, LXF_IDENT, LXF_IDENT_LENGTH)) {
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR_EOF;
memmove(buf, &buf[1], LXF_IDENT_LENGTH-1);

View File

@ -654,7 +654,7 @@ static int matroska_resync(MatroskaDemuxContext *matroska, int64_t last_pos)
id = avio_rb32(pb);
// try to find a toplevel element
while (!url_feof(pb)) {
while (!avio_feof(pb)) {
if (id == MATROSKA_ID_INFO || id == MATROSKA_ID_TRACKS ||
id == MATROSKA_ID_CUES || id == MATROSKA_ID_TAGS ||
id == MATROSKA_ID_SEEKHEAD || id == MATROSKA_ID_ATTACHMENTS ||
@ -707,7 +707,7 @@ static int ebml_read_num(MatroskaDemuxContext *matroska, AVIOContext *pb,
* use it safely here to catch EOS. */
if (!(total = avio_r8(pb))) {
/* we might encounter EOS here */
if (!url_feof(pb)) {
if (!avio_feof(pb)) {
int64_t pos = avio_tell(pb);
av_log(matroska->ctx, AV_LOG_ERROR,
"Read error at pos. %"PRIu64" (0x%"PRIx64")\n",

View File

@ -74,7 +74,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
uint32_t chunk_size, payload_size;
int ret;
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
avio_skip(pb, 4);

View File

@ -88,7 +88,7 @@ static int microdvd_read_header(AVFormatContext *s)
if (!st)
return AVERROR(ENOMEM);
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
char *p;
AVPacket *sub;
int64_t pos = avio_tell(s->pb);

View File

@ -126,7 +126,7 @@ static int scan_file(AVFormatContext *avctx, AVStream *vst, AVStream *ast, int f
MlvContext *mlv = avctx->priv_data;
AVIOContext *pb = mlv->pb[file];
int ret;
while (!url_feof(pb)) {
while (!avio_feof(pb)) {
int type;
unsigned int size;
type = avio_rl32(pb);

View File

@ -286,7 +286,7 @@ static int mmf_read_packet(AVFormatContext *s, AVPacket *pkt)
left = mmf->data_end - avio_tell(s->pb);
size = FFMIN(left, MAX_SIZE);
if (url_feof(s->pb) || size <= 0)
if (avio_feof(s->pb) || size <= 0)
return AVERROR_EOF;
ret = av_get_packet(s->pb, pkt, size);

View File

@ -485,7 +485,7 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
avio_skip(pb, 16);
for (type = 0; type != -1 && avio_tell(pb) < next; ) {
if(url_feof(pb))
if(avio_feof(pb))
return AVERROR_EOF;
type = avio_rb16(pb);
len = avio_rb16(pb);
@ -3173,7 +3173,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (atom.size < 0)
atom.size = INT64_MAX;
while (total_size + 8 <= atom.size && !url_feof(pb)) {
while (total_size + 8 <= atom.size && !avio_feof(pb)) {
int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL;
a.size = atom.size;
a.type=0;
@ -3721,7 +3721,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
avio_seek(s->pb, mov->next_root_atom, SEEK_SET);
mov->next_root_atom = 0;
if (mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
url_feof(s->pb))
avio_feof(s->pb))
return AVERROR_EOF;
av_dlog(s, "read fragments, offset 0x%"PRIx64"\n", avio_tell(s->pb));
goto retry;

View File

@ -220,7 +220,7 @@ static int mpc8_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
}
while(!url_feof(pb)){
while(!avio_feof(pb)){
pos = avio_tell(pb);
mpc8_get_chunk_header(pb, &tag, &size);
if(tag == TAG_STREAMHDR)
@ -275,7 +275,7 @@ static int mpc8_read_packet(AVFormatContext *s, AVPacket *pkt)
int tag;
int64_t pos, size;
while(!url_feof(s->pb)){
while(!avio_feof(s->pb)){
pos = avio_tell(s->pb);
/* don't return bogus packets with the ape tag data */

View File

@ -168,7 +168,7 @@ static int find_next_start_code(AVIOContext *pb, int *size_ptr,
state = *header_state;
n = *size_ptr;
while (n > 0) {
if (url_feof(pb))
if (avio_feof(pb))
break;
v = avio_r8(pb);
n--;
@ -246,7 +246,7 @@ redo:
startcode = find_next_start_code(s->pb, &size, &m->header_state);
last_sync = avio_tell(s->pb);
if (startcode < 0) {
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR_EOF;
// FIXME we should remember header_state
return AVERROR(EAGAIN);
@ -702,7 +702,7 @@ static int vobsub_read_header(AVFormatContext *s)
}
av_bprint_init(&header, 0, AV_BPRINT_SIZE_UNLIMITED);
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
char line[MAX_LINE_SIZE];
int len = ff_get_line(s->pb, line, sizeof(line));

View File

@ -2192,7 +2192,7 @@ static int mpegts_resync(AVFormatContext *s)
for (i = 0; i < MAX_RESYNC_SIZE; i++) {
c = avio_r8(pb);
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
if (c == 0x47) {
avio_seek(pb, -1, SEEK_CUR);

View File

@ -83,7 +83,7 @@ static int mpl2_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codec->codec_id = AV_CODEC_ID_MPL2;
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
char line[4096];
char *p = line;
const int64_t pos = avio_tell(s->pb);

View File

@ -63,7 +63,7 @@ static int mpsub_read_header(AVFormatContext *s)
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
char line[1024];
float start, duration;
int fps, len = ff_get_line(s->pb, line, sizeof(line));

View File

@ -89,9 +89,9 @@ static int msnwc_tcp_read_header(AVFormatContext *ctx)
/* Some files start with "connected\r\n\r\n".
* So skip until we find the first byte of struct size */
while(avio_r8(pb) != HEADER_SIZE && !url_feof(pb));
while(avio_r8(pb) != HEADER_SIZE && !avio_feof(pb));
if(url_feof(pb)) {
if(avio_feof(pb)) {
av_log(ctx, AV_LOG_ERROR, "Could not find valid start.\n");
return -1;
}

View File

@ -284,7 +284,7 @@ static int64_t klv_decode_ber_length(AVIOContext *pb)
static int mxf_read_sync(AVIOContext *pb, const uint8_t *key, unsigned size)
{
int i, b;
for (i = 0; i < size && !url_feof(pb); i++) {
for (i = 0; i < size && !avio_feof(pb); i++) {
b = avio_r8(pb);
if (b == key[0])
i = 0;
@ -1874,7 +1874,7 @@ static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadF
if (!ctx)
return AVERROR(ENOMEM);
while (avio_tell(pb) + 4 < klv_end && !url_feof(pb)) {
while (avio_tell(pb) + 4 < klv_end && !avio_feof(pb)) {
int ret;
int tag = avio_rb16(pb);
int size = avio_rb16(pb); /* KLV specified by 0x53 */
@ -2122,7 +2122,7 @@ static int mxf_read_header(AVFormatContext *s)
mxf_read_random_index_pack(s);
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
const MXFMetadataReadTableEntry *metadata;
if (avio_tell(s->pb) == last_pos) {
av_log(mxf->fc, AV_LOG_ERROR, "MXF structure loop detected\n");
@ -2450,7 +2450,7 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt)
skip:
avio_skip(s->pb, klv.length);
}
return url_feof(s->pb) ? AVERROR_EOF : ret;
return avio_feof(s->pb) ? AVERROR_EOF : ret;
}
static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)

View File

@ -136,7 +136,7 @@ static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt)
uint8_t *startmarker_ptr, *end, *search_end, marker;
MXGContext *mxg = s->priv_data;
while (!url_feof(s->pb) && !s->pb->error){
while (!avio_feof(s->pb) && !s->pb->error){
if (mxg->cache_size <= OVERREAD_SIZE) {
/* update internal buffer */
ret = mxg_update_cache(s, DEFAULT_PACKET_SIZE + OVERREAD_SIZE);

View File

@ -67,7 +67,7 @@ static int nc_read_packet(AVFormatContext *s, AVPacket *pkt)
uint32_t state=-1;
while (state != NC_VIDEO_FLAG) {
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR(EIO);
state = (state<<8) + avio_r8(s->pb);
}

View File

@ -51,7 +51,7 @@ static int nist_read_header(AVFormatContext *s)
if (header_size <= 0)
return AVERROR_INVALIDDATA;
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
ff_get_line(s->pb, buffer, sizeof(buffer));
if (avio_tell(s->pb) >= header_size)

View File

@ -232,7 +232,7 @@ static int nsv_resync(AVFormatContext *s)
//nsv->state = NSV_UNSYNC;
for (i = 0; i < NSV_MAX_RESYNC; i++) {
if (url_feof(pb)) {
if (avio_feof(pb)) {
av_dlog(s, "NSV EOF\n");
nsv->state = NSV_UNSYNC;
return -1;
@ -299,7 +299,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s)
table_entries_used = avio_rl32(pb);
av_dlog(s, "NSV NSVf info-strings size: %d, table entries: %d, bis %d\n",
strings_size, table_entries, table_entries_used);
if (url_feof(pb))
if (avio_feof(pb))
return -1;
av_dlog(s, "NSV got header; filepos %"PRId64"\n", avio_tell(pb));
@ -336,7 +336,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s)
}
av_free(strings);
}
if (url_feof(pb))
if (avio_feof(pb))
return -1;
av_dlog(s, "NSV got infos; filepos %"PRId64"\n", avio_tell(pb));
@ -368,7 +368,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s)
avio_seek(pb, nsv->base_offset + size, SEEK_SET); /* required for dumbdriving-271.nsv (2 extra bytes) */
if (url_feof(pb))
if (avio_feof(pb))
return -1;
nsv->state = NSV_HAS_READ_NSVF;
return 0;
@ -546,7 +546,7 @@ static int nsv_read_chunk(AVFormatContext *s, int fill_header)
return 0; //-1; /* hey! eat what you've in your plate first! */
null_chunk_retry:
if (url_feof(pb))
if (avio_feof(pb))
return -1;
for (i = 0; i < NSV_MAX_RESYNC_TRIES && nsv->state < NSV_FOUND_NSVS && !err; i++)
@ -581,7 +581,7 @@ null_chunk_retry:
vsize -= auxsize + sizeof(uint16_t) + sizeof(uint32_t); /* that's becoming braindead */
}
if (url_feof(pb))
if (avio_feof(pb))
return -1;
if (!vsize && !asize) {
nsv->state = NSV_UNSYNC;

View File

@ -146,7 +146,7 @@ static uint64_t find_any_startcode(AVIOContext *bc, int64_t pos)
/* 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);
while (!url_feof(bc)) {
while (!avio_feof(bc)) {
state = (state << 8) | avio_r8(bc);
if ((state >> 56) != 'N')
continue;
@ -1056,7 +1056,7 @@ static int nut_read_packet(AVFormatContext *s, AVPacket *pkt)
pos -= 8;
} else {
frame_code = avio_r8(bc);
if (url_feof(bc))
if (avio_feof(bc))
return AVERROR_EOF;
if (frame_code == 'N') {
tmp = frame_code;

View File

@ -72,7 +72,7 @@ static int get_codec_data(AVIOContext *pb, AVStream *vst,
if (!vst && !myth)
return 1; // no codec data needed
while (!url_feof(pb)) {
while (!avio_feof(pb)) {
int size, subtype;
frametype = avio_r8(pb);
@ -236,7 +236,7 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt)
nuv_frametype frametype;
int ret, size;
while (!url_feof(pb)) {
while (!avio_feof(pb)) {
int copyhdrsize = ctx->rtjpg_video ? HDRSIZE : 0;
uint64_t pos = avio_tell(pb);
@ -309,7 +309,7 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt)
static int nuv_resync(AVFormatContext *s, int64_t pos_limit) {
AVIOContext *pb = s->pb;
uint32_t tag = 0;
while(!url_feof(pb) && avio_tell(pb) < pos_limit) {
while(!avio_feof(pb) && avio_tell(pb) < pos_limit) {
tag = (tag << 8) | avio_r8(pb);
if (tag == MKBETAG('R','T','j','j') &&
(tag = avio_rb32(pb)) == MKBETAG('j','j','j','j') &&
@ -339,7 +339,7 @@ static int64_t nuv_read_dts(AVFormatContext *s, int stream_index,
if (!nuv_resync(s, pos_limit))
return AV_NOPTS_VALUE;
while (!url_feof(pb) && avio_tell(pb) < pos_limit) {
while (!avio_feof(pb) && avio_tell(pb) < pos_limit) {
if (avio_read(pb, hdr, HDRSIZE) < HDRSIZE)
return AV_NOPTS_VALUE;
frametype = hdr[0];

View File

@ -331,7 +331,7 @@ static int ogg_read_page(AVFormatContext *s, int *sid)
c = avio_r8(bc);
if (url_feof(bc))
if (avio_feof(bc))
return AVERROR_EOF;
sync[sp++ & 3] = c;

View File

@ -199,7 +199,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
if (p->current_frame >= p->nb_frames)
return AVERROR_EOF;
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
if (p->got_audio) {

View File

@ -73,7 +73,7 @@ static int pjs_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codec->codec_id = AV_CODEC_ID_PJS;
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
char line[4096];
char *p = line;
const int64_t pos = avio_tell(s->pb);

View File

@ -97,7 +97,7 @@ static int pmp_header(AVFormatContext *s)
for (i = 0; i < index_cnt; i++) {
uint32_t size = avio_rl32(pb);
int flags = size & 1 ? AVINDEX_KEYFRAME : 0;
if (url_feof(pb)) {
if (avio_feof(pb)) {
av_log(s, AV_LOG_FATAL, "Encountered EOF while reading index.\n");
return AVERROR_INVALIDDATA;
}
@ -133,7 +133,7 @@ static int pmp_packet(AVFormatContext *s, AVPacket *pkt)
int ret = 0;
int i;
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
if (pmp->cur_stream == 0) {
int num_packets;

View File

@ -292,7 +292,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
break;
}
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR(EIO);
}
}

View File

@ -139,7 +139,7 @@ static int qcp_read_packet(AVFormatContext *s, AVPacket *pkt)
QCPContext *c = s->priv_data;
unsigned int chunk_size, tag;
while(!url_feof(pb)) {
while(!avio_feof(pb)) {
if (c->data_size) {
int pkt_size, ret, mode = avio_r8(pb);

View File

@ -72,7 +72,7 @@ static int realtext_read_header(AVFormatContext *s)
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
AVPacket *sub;
const int64_t pos = avio_tell(s->pb) - (c != 0);
int n = ff_smil_extract_next_chunk(s->pb, &buf, &c);

View File

@ -143,7 +143,7 @@ static int redspark_read_packet(AVFormatContext *s, AVPacket *pkt)
uint32_t size = 8 * codec->channels;
int ret;
if (url_feof(s->pb) || redspark->samples_count == s->streams[0]->duration)
if (avio_feof(s->pb) || redspark->samples_count == s->streams[0]->duration)
return AVERROR_EOF;
ret = av_get_packet(s->pb, pkt, size);

View File

@ -191,7 +191,7 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
chunk_code = avio_rl32(pb);
chunk_size = avio_rl32(pb);
if (url_feof(pb)) {
if (avio_feof(pb)) {
if (chunk_code || chunk_size) {
av_log(s, AV_LOG_WARNING, "INFO subchunk truncated\n");
return AVERROR_INVALIDDATA;

View File

@ -494,7 +494,7 @@ static int rm_read_header(AVFormatContext *s)
avio_skip(pb, tag_size - 8);
for(;;) {
if (url_feof(pb))
if (avio_feof(pb))
return -1;
tag = avio_rl32(pb);
tag_size = avio_rb32(pb);
@ -601,7 +601,7 @@ static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_
AVStream *st;
uint32_t state=0xFFFFFFFF;
while(!url_feof(pb)){
while(!avio_feof(pb)){
int len, num, i;
*pos= avio_tell(pb) - 3;
if(rm->remaining_len > 0){
@ -953,7 +953,7 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
st = s->streams[i];
}
if(len<0 || url_feof(s->pb))
if(len<0 || avio_feof(s->pb))
return AVERROR(EIO);
res = ff_rm_parse_packet (s, s->pb, st, st->priv_data, len, pkt,

View File

@ -60,7 +60,7 @@ static int read_line(AVIOContext * pb, char* line, int bufsize)
break;
if (b == '\n') {
line[i] = '\0';
return url_feof(pb) ? -1 : 0;
return avio_feof(pb) ? -1 : 0;
}
line[i] = b;
}

View File

@ -137,7 +137,7 @@ static int rsd_read_packet(AVFormatContext *s, AVPacket *pkt)
AVCodecContext *codec = s->streams[0]->codec;
int ret, size = 1024;
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR_EOF;
if (codec->codec_id == AV_CODEC_ID_ADPCM_IMA_RAD)

View File

@ -62,7 +62,7 @@ static int sami_read_header(AVFormatContext *s)
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
av_bprint_init(&hdr_buf, 0, AV_BPRINT_SIZE_UNLIMITED);
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
AVPacket *sub;
const int64_t pos = avio_tell(s->pb) - (c != 0);
int is_sync, n = ff_smil_extract_next_chunk(s->pb, &buf, &c);

View File

@ -257,7 +257,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
int frame_size = 0;
int palchange = 0;
if (url_feof(s->pb) || smk->cur_frame >= smk->frames)
if (avio_feof(s->pb) || smk->cur_frame >= smk->frames)
return AVERROR_EOF;
/* if we demuxed all streams, pass another frame */

View File

@ -58,7 +58,7 @@ static int smjpeg_read_header(AVFormatContext *s)
duration = avio_rb32(pb); // in msec
while (!url_feof(pb)) {
while (!avio_feof(pb)) {
htype = avio_rl32(pb);
switch (htype) {
case SMJPEG_TXT:
@ -141,7 +141,7 @@ static int smjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t pos;
int ret;
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR_EOF;
pos = avio_tell(s->pb);
dtype = avio_rl32(s->pb);

View File

@ -102,7 +102,7 @@ static int smush_read_header(AVFormatContext *ctx)
while (!got_audio && ((read + 8) < size)) {
uint32_t sig, chunk_size;
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
sig = avio_rb32(pb);
@ -196,7 +196,7 @@ static int smush_read_packet(AVFormatContext *ctx, AVPacket *pkt)
while (!done) {
uint32_t sig, size;
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
sig = avio_rb32(pb);

View File

@ -131,7 +131,7 @@ static int sol_read_packet(AVFormatContext *s,
{
int ret;
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR(EIO);
ret= av_get_packet(s->pb, pkt, MAX_SIZE);
if (ret < 0)

View File

@ -176,7 +176,7 @@ int ff_spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
while (state != (AV_BSWAP16C(SYNCWORD1) << 16 | AV_BSWAP16C(SYNCWORD2))) {
state = (state << 8) | avio_r8(pb);
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
}

View File

@ -88,7 +88,7 @@ static int srt_read_header(AVFormatContext *s)
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
ff_subtitles_read_chunk(s->pb, &buf);
if (buf.len) {

View File

@ -53,7 +53,7 @@ static int subviewer1_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codec->codec_id = AV_CODEC_ID_SUBVIEWER1;
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
char line[4096];
int len = ff_get_line(s->pb, line, sizeof(line));
int hh, mm, ss;

View File

@ -84,7 +84,7 @@ static int subviewer_read_header(AVFormatContext *s)
av_bprint_init(&header, 0, AV_BPRINT_SIZE_UNLIMITED);
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
char line[2048];
int64_t pos = 0;
int len = ff_get_line(s->pb, line, sizeof(line));

View File

@ -39,7 +39,7 @@ static int get_swf_tag(AVIOContext *pb, int *len_ptr)
{
int tag, len;
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
tag = avio_rl16(pb);

View File

@ -68,7 +68,7 @@ static int tak_read_header(AVFormatContext *s)
return 0;
}
while (!url_feof(pb)) {
while (!avio_feof(pb)) {
enum TAKMetaDataType type;
int size;

View File

@ -154,7 +154,7 @@ static int tmv_read_packet(AVFormatContext *s, AVPacket *pkt)
int ret, pkt_size = tmv->stream_index ?
tmv->audio_chunk_size : tmv->video_chunk_size;
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
ret = av_get_packet(pb, pkt, pkt_size);

View File

@ -113,7 +113,7 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
TtyDemuxContext *s = avctx->priv_data;
int n;
if (url_feof(avctx->pb))
if (avio_feof(avctx->pb))
return AVERROR_EOF;
n = s->chars_per_frame;

View File

@ -63,7 +63,7 @@ next_chunk:
chunk_size = avio_rl32(pb);
marker = avio_rl32(pb);
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR_EOF;
if (marker != TXD_MARKER && marker != TXD_MARKER2) {
av_log(s, AV_LOG_ERROR, "marker does not match\n");

View File

@ -91,7 +91,7 @@ static int vc1t_read_packet(AVFormatContext *s,
int keyframe = 0;
uint32_t pts;
if(url_feof(pb))
if(avio_feof(pb))
return AVERROR(EIO);
frame_size = avio_rl24(pb);

View File

@ -75,7 +75,7 @@ static int vivo_get_packet_header(AVFormatContext *s)
AVIOContext *pb = s->pb;
unsigned c, get_length = 0;
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
c = avio_r8(pb);
@ -250,7 +250,7 @@ static int vivo_read_packet(AVFormatContext *s, AVPacket *pkt)
restart:
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
switch (vivo->type) {
@ -281,7 +281,7 @@ restart:
while (vivo->sequence == old_sequence &&
(((vivo->type - 1) >> 1) == ((old_type - 1) >> 1))) {
if (url_feof(pb)) {
if (avio_feof(pb)) {
ret = AVERROR_EOF;
break;
}

View File

@ -65,7 +65,7 @@ static int vplayer_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codec->codec_id = AV_CODEC_ID_VPLAYER;
while (!url_feof(s->pb)) {
while (!avio_feof(s->pb)) {
char line[4096];
char *p = line;
const int64_t pos = avio_tell(s->pb);

View File

@ -166,7 +166,7 @@ static int vqf_read_header(AVFormatContext *s)
header_size -= len;
} while (header_size >= 0 && !url_feof(s->pb));
} while (header_size >= 0 && !avio_feof(s->pb));
switch (rate_flag) {
case -1:

View File

@ -82,7 +82,7 @@ static int64_t find_tag(WAVDemuxContext * wav, AVIOContext *pb, uint32_t tag1)
int64_t size;
for (;;) {
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR_EOF;
size = next_tag(pb, &tag);
if (tag == tag1)
@ -291,7 +291,7 @@ static int wav_read_header(AVFormatContext *s)
size = next_tag(pb, &tag);
next_tag_ofs = avio_tell(pb) + size;
if (url_feof(pb))
if (avio_feof(pb))
break;
switch (tag) {
@ -434,7 +434,7 @@ static int64_t find_guid(AVIOContext *pb, const uint8_t guid1[16])
uint8_t guid[16];
int64_t size;
while (!url_feof(pb)) {
while (!avio_feof(pb)) {
avio_read(pb, guid, 16);
size = avio_rl64(pb);
if (size <= 24)
@ -652,7 +652,7 @@ static int w64_read_header(AVFormatContext *s)
if (!st)
return AVERROR(ENOMEM);
while (!url_feof(pb)) {
while (!avio_feof(pb)) {
if (avio_read(pb, guid, 16) != 16)
break;
size = avio_rl64(pb);
@ -692,7 +692,7 @@ static int w64_read_header(AVFormatContext *s)
for (i = 0; i < count; i++) {
char chunk_key[5], *value;
if (url_feof(pb) || (cur = avio_tell(pb)) < 0 || cur > end - 8 /* = tag + size */)
if (avio_feof(pb) || (cur = avio_tell(pb)) < 0 || cur > end - 8 /* = tag + size */)
break;
chunk_key[4] = 0;

View File

@ -159,7 +159,7 @@ static int wc3_read_header(AVFormatContext *s)
fourcc_tag = avio_rl32(pb);
/* chunk sizes are 16-bit aligned */
size = (avio_rb32(pb) + 1) & (~1);
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR(EIO);
} while (fourcc_tag != BRCH_TAG);
@ -211,7 +211,7 @@ static int wc3_read_packet(AVFormatContext *s,
fourcc_tag = avio_rl32(pb);
/* chunk sizes are 16-bit aligned */
size = (avio_rb32(pb) + 1) & (~1);
if (url_feof(pb))
if (avio_feof(pb))
return AVERROR(EIO);
switch (fourcc_tag) {

View File

@ -76,7 +76,7 @@ static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size)
if (wf->error || pb->error)
return -1;
if (wf->position >= wf->length || url_feof(pb))
if (wf->position >= wf->length || avio_feof(pb))
return 0;
buf_size = FFMIN(buf_size, wf->length - wf->position);
@ -533,7 +533,7 @@ static void parse_legacy_attrib(AVFormatContext *s, AVIOContext *pb)
{
ff_asf_guid guid;
int length, type;
while(!url_feof(pb)) {
while(!avio_feof(pb)) {
char key[1024];
ff_get_guid(pb, &guid);
type = avio_rl32(pb);
@ -761,7 +761,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
{
WtvContext *wtv = s->priv_data;
AVIOContext *pb = wtv->pb;
while (!url_feof(pb)) {
while (!avio_feof(pb)) {
ff_asf_guid g;
int len, sid, consumed;
@ -981,7 +981,7 @@ static int read_header(AVFormatContext *s)
while(1) {
uint64_t timestamp = avio_rl64(pb);
uint64_t frame_nb = avio_rl64(pb);
if (url_feof(pb))
if (avio_feof(pb))
break;
ff_add_index_entry(&wtv->index_entries, &wtv->nb_index_entries, &wtv->index_entries_allocated_size,
0, timestamp, frame_nb, 0, AVINDEX_KEYFRAME);
@ -995,7 +995,7 @@ static int read_header(AVFormatContext *s)
while (1) {
uint64_t frame_nb = avio_rl64(pb);
uint64_t position = avio_rl64(pb);
if (url_feof(pb))
if (avio_feof(pb))
break;
for (i = wtv->nb_index_entries - 1; i >= 0; i--) {
AVIndexEntry *e = wtv->index_entries + i;

View File

@ -260,7 +260,7 @@ static int wv_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t pos;
uint32_t block_samples;
if (url_feof(s->pb))
if (avio_feof(s->pb))
return AVERROR_EOF;
if (wc->block_parsed) {
if ((ret = wv_read_block_header(s, s->pb)) < 0)