[FFmpeg-devel] [PATCH] avio: deprecate url_feof
Anton Khirnov
anton
Mon Mar 7 21:50:25 CET 2011
AVIOContext.eof_reached should be used directly instead.
---
ffplay.c | 2 +-
libavformat/4xm.c | 2 +-
libavformat/aiffdec.c | 2 +-
libavformat/amr.c | 2 +-
libavformat/anm.c | 2 +-
libavformat/ape.c | 2 +-
libavformat/applehttp.c | 4 ++--
libavformat/applehttpproto.c | 2 +-
libavformat/asfdec.c | 12 ++++++------
libavformat/assdec.c | 2 +-
libavformat/avidec.c | 12 ++++++------
libavformat/avio.h | 11 +++++------
libavformat/aviobuf.c | 10 ++++++----
libavformat/bethsoftvid.c | 2 +-
libavformat/bfi.c | 4 ++--
libavformat/cafdec.c | 6 +++---
libavformat/daud.c | 2 +-
libavformat/dsicin.c | 2 +-
libavformat/dv.c | 2 +-
libavformat/dxa.c | 4 ++--
libavformat/electronicarts.c | 4 ++--
libavformat/ffmdec.c | 2 +-
libavformat/ffmetadec.c | 4 ++--
libavformat/filmstripdec.c | 2 +-
libavformat/flacdec.c | 2 +-
libavformat/flvdec.c | 2 +-
libavformat/gxf.c | 6 +++---
libavformat/idcin.c | 2 +-
libavformat/idroqdec.c | 2 +-
libavformat/iff.c | 2 +-
libavformat/img2.c | 2 +-
libavformat/ipmovie.c | 6 +++---
libavformat/lxfdec.c | 2 +-
libavformat/matroskadec.c | 2 +-
libavformat/mmf.c | 2 +-
libavformat/mov.c | 4 ++--
libavformat/mpc8.c | 4 ++--
libavformat/mpeg.c | 4 ++--
libavformat/mpegts.c | 2 +-
libavformat/msnwc_tcp.c | 4 ++--
libavformat/mxfdec.c | 6 +++---
libavformat/mxg.c | 2 +-
libavformat/ncdec.c | 2 +-
libavformat/nsvdec.c | 12 ++++++------
libavformat/nutdec.c | 4 ++--
libavformat/nuv.c | 4 ++--
libavformat/oggdec.c | 2 +-
libavformat/psxstr.c | 2 +-
libavformat/qcp.c | 2 +-
libavformat/rmdec.c | 6 +++---
libavformat/smacker.c | 2 +-
libavformat/sol.c | 2 +-
libavformat/soxdec.c | 2 +-
libavformat/spdifdec.c | 2 +-
libavformat/srtdec.c | 2 +-
libavformat/swfdec.c | 2 +-
libavformat/tmv.c | 2 +-
libavformat/tty.c | 2 +-
libavformat/txd.c | 2 +-
libavformat/vc1test.c | 2 +-
libavformat/wav.c | 6 +++---
libavformat/wc3movie.c | 4 ++--
libavformat/wtv.c | 10 +++++-----
libavformat/wv.c | 2 +-
64 files changed, 116 insertions(+), 115 deletions(-)
diff --git a/ffplay.c b/ffplay.c
index e304aab..6019437 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2568,7 +2568,7 @@ static int decode_thread(void *arg)
}
ret = av_read_frame(ic, pkt);
if (ret < 0) {
- if (ret == AVERROR_EOF || url_feof(ic->pb))
+ if (ret == AVERROR_EOF || ic->pb->eof_reached)
eof=1;
if (url_ferror(ic->pb))
break;
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index ed72280..95bd717 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -259,7 +259,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 (pb->eof_reached)
return AVERROR(EIO);
switch (fourcc_tag) {
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 9e3d39c..8506d8b 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -51,7 +51,7 @@ static int get_tag(AVIOContext *pb, uint32_t * tag)
{
int size;
- if (url_feof(pb))
+ if (pb->eof_reached)
return AVERROR(EIO);
*tag = avio_rl32(pb);
diff --git a/libavformat/amr.c b/libavformat/amr.c
index 9d6581d..522d83e 100644
--- a/libavformat/amr.c
+++ b/libavformat/amr.c
@@ -122,7 +122,7 @@ static int amr_read_packet(AVFormatContext *s,
AVCodecContext *enc = s->streams[0]->codec;
int read, size = 0, toc, mode;
- if (url_feof(s->pb))
+ if (s->pb->eof_reached)
{
return AVERROR(EIO);
}
diff --git a/libavformat/anm.c b/libavformat/anm.c
index 2a0109d..980920f 100644
--- a/libavformat/anm.c
+++ b/libavformat/anm.c
@@ -181,7 +181,7 @@ static int read_packet(AVFormatContext *s,
Page *p;
int tmp, record_size;
- if (url_feof(s->pb))
+ if (s->pb->eof_reached)
return AVERROR(EIO);
if (anm->page < 0)
diff --git a/libavformat/ape.c b/libavformat/ape.c
index 2de47ef..6c26984 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -337,7 +337,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 (s->pb->eof_reached)
return AVERROR(EIO);
if (ape->currentframe > ape->totalframes)
return AVERROR(EIO);
diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c
index 5118d03..c1609b8 100644
--- a/libavformat/applehttp.c
+++ b/libavformat/applehttp.c
@@ -224,7 +224,7 @@ static int parse_playlist(AppleHTTPContext *c, const char *url,
if (var)
free_segment_list(var);
c->finished = 0;
- while (!url_feof(in)) {
+ while (!in->eof_reached) {
read_chomp_line(in, line, sizeof(line));
if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
struct variant_info info = {{0}};
@@ -457,7 +457,7 @@ start:
if (var->pb && !var->pkt.data) {
ret = av_read_frame(var->ctx, &var->pkt);
if (ret < 0) {
- if (!url_feof(var->pb))
+ if (!var->pb->eof_reached)
return ret;
reset_packet(&var->pkt);
}
diff --git a/libavformat/applehttpproto.c b/libavformat/applehttpproto.c
index 471f94b..8307130 100644
--- a/libavformat/applehttpproto.c
+++ b/libavformat/applehttpproto.c
@@ -174,7 +174,7 @@ static int parse_playlist(URLContext *h, const char *url)
free_segment_list(s);
s->finished = 0;
- while (!url_feof(in)) {
+ while (!in->eof_reached) {
read_chomp_line(in, line, sizeof(line));
if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
struct variant_info info = {{0}};
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index e3a3807..10d3449 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -639,7 +639,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
continue;
} else if (!ff_guidcmp(&g, &ff_asf_marker_header)) {
asf_read_marker(s, gsize);
- } else if (url_feof(pb)) {
+ } else if (pb->eof_reached) {
return -1;
} else {
if (!s->keylen) {
@@ -660,7 +660,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
avio_rl64(pb);
avio_r8(pb);
avio_r8(pb);
- if (url_feof(pb))
+ if (pb->eof_reached)
return -1;
asf->data_offset = avio_tell(pb);
asf->packet_size_left = 0;
@@ -745,12 +745,12 @@ static int ff_asf_get_packet(AVFormatContext *s, AVIOContext *pb)
*/
if (url_ferror(pb) == AVERROR(EAGAIN))
return AVERROR(EAGAIN);
- if (!url_feof(pb))
+ if (!pb->eof_reached)
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 (!pb->eof_reached)
av_log(s, AV_LOG_ERROR, "ff asf bad non zero\n");
return -1;
}
@@ -886,7 +886,7 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
ASFStream *asf_st = 0;
for (;;) {
int ret;
- if(url_feof(pb))
+ if(pb->eof_reached)
return AVERROR_EOF;
if (asf->packet_size_left < FRAME_HEADER_SIZE
|| asf->packet_segments < 1) {
@@ -1195,7 +1195,7 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
skip them until the simple index object is reached */
while (ff_guidcmp(&g, &index_guid)) {
int64_t gsize= avio_rl64(s->pb);
- if (gsize < 24 || url_feof(s->pb)) {
+ if (gsize < 24 || s->pb->eof_reached) {
avio_seek(s->pb, current_pos, SEEK_SET);
return;
}
diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index e04d92a..abaf942 100644
--- a/libavformat/assdec.c
+++ b/libavformat/assdec.c
@@ -92,7 +92,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
header_remaining= INT_MAX;
dst[0] = &st->codec->extradata;
dst[1] = &ass->event_buffer;
- while(!url_feof(pb)){
+ while(!pb->eof_reached){
uint8_t line[MAX_LINESIZE];
len = ff_get_line(pb, line, sizeof(line));
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 83b86d8..8181298 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -178,7 +178,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(pb->eof_reached)
return -1;
if(last_pos == pos || pos == base - 8)
@@ -195,7 +195,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(pb->eof_reached)
return -1;
pos = avio_tell(pb);
@@ -360,7 +360,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
codec_type = -1;
frame_period = 0;
for(;;) {
- if (url_feof(pb))
+ if (pb->eof_reached)
goto fail;
tag = avio_rl32(pb);
size = avio_rl32(pb);
@@ -989,7 +989,7 @@ resync:
}
memset(d, -1, sizeof(int)*8);
- for(i=sync=avio_tell(pb); !url_feof(pb); i++) {
+ for(i=sync=avio_tell(pb); !pb->eof_reached; i++) {
int j;
for(j=0; j<7; j++)
@@ -1145,7 +1145,7 @@ static int avi_read_idx1(AVFormatContext *s, int size)
#if defined(DEBUG_SEEK)
av_log(s, AV_LOG_DEBUG, "%d cum_len=%"PRId64"\n", len, ast->cum_len);
#endif
- if(url_feof(pb))
+ if(pb->eof_reached)
return -1;
if(last_pos == pos)
@@ -1203,7 +1203,7 @@ static int avi_load_index(AVFormatContext *s)
printf("movi_end=0x%"PRIx64"\n", avi->movi_end);
#endif
for(;;) {
- if (url_feof(pb))
+ if (pb->eof_reached)
break;
tag = avio_rl32(pb);
size = avio_rl32(pb);
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 8bae263..2949629 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -432,6 +432,11 @@ attribute_deprecated int url_fgetc(AVIOContext *s);
/**
* @}
*/
+
+/**
+ * @deprecated use AVIOContext.eof_reached
+ */
+attribute_deprecated int url_feof(AVIOContext *s);
#endif
AVIOContext *avio_alloc_context(
@@ -494,12 +499,6 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
*/
int64_t avio_size(AVIOContext *s);
-/**
- * feof() equivalent for AVIOContext.
- * @return non zero if and only if end of file
- */
-int url_feof(AVIOContext *s);
-
int url_ferror(AVIOContext *s);
int av_url_read_fpause(AVIOContext *h, int pause);
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 7762d6c..d0f63df 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -265,12 +265,14 @@ int64_t avio_size(AVIOContext *s)
return size;
}
+#if FF_API_OLD_AVIO
int url_feof(AVIOContext *s)
{
if(!s)
return 0;
return s->eof_reached;
}
+#endif
int url_ferror(AVIOContext *s)
{
@@ -598,7 +600,7 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size)
}
if (size1 == size) {
if (url_ferror(s)) return url_ferror(s);
- if (url_feof(s)) return AVERROR_EOF;
+ if (s->eof_reached) return AVERROR_EOF;
}
return size1 - size;
}
@@ -621,7 +623,7 @@ int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size)
s->buf_ptr += len;
if (!len) {
if (url_ferror(s)) return url_ferror(s);
- if (url_feof(s)) return AVERROR_EOF;
+ if (s->eof_reached) return AVERROR_EOF;
}
return len;
}
@@ -928,11 +930,11 @@ char *url_fgets(AVIOContext *s, char *buf, int buf_size)
char *q;
c = avio_r8(s);
- if (url_feof(s))
+ if (s->eof_reached)
return NULL;
q = buf;
for(;;) {
- if (url_feof(s) || c == '\n')
+ if (s->eof_reached || c == '\n')
break;
if ((q - buf) < buf_size - 1)
*q++ = c;
diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c
index 7987e8e..0b45115 100644
--- a/libavformat/bethsoftvid.c
+++ b/libavformat/bethsoftvid.c
@@ -179,7 +179,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 || pb->eof_reached)
return AVERROR(EIO);
block_type = avio_r8(pb);
diff --git a/libavformat/bfi.c b/libavformat/bfi.c
index 21676e4..cec02fd 100644
--- a/libavformat/bfi.c
+++ b/libavformat/bfi.c
@@ -109,7 +109,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 || pb->eof_reached) {
return AVERROR(EIO);
}
@@ -117,7 +117,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 (pb->eof_reached)
return AVERROR(EIO);
state = 256*state + avio_r8(pb);
}
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 9db7608..ec3054f 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -219,7 +219,7 @@ static int read_header(AVFormatContext *s,
/* parse each chunk */
found_data = 0;
- while (!url_feof(pb)) {
+ while (!pb->eof_reached) {
/* stop at data chunk if seeking is not supported or
data chunk size is unknown */
@@ -228,7 +228,7 @@ static int read_header(AVFormatContext *s,
tag = avio_rb32(pb);
size = avio_rb64(pb);
- if (url_feof(pb))
+ if (pb->eof_reached)
break;
switch (tag) {
@@ -307,7 +307,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 (pb->eof_reached)
return AVERROR(EIO);
/* don't read past end of data chunk */
diff --git a/libavformat/daud.c b/libavformat/daud.c
index 39a994b..f852105 100644
--- a/libavformat/daud.c
+++ b/libavformat/daud.c
@@ -38,7 +38,7 @@ static int daud_header(AVFormatContext *s, AVFormatParameters *ap) {
static int daud_packet(AVFormatContext *s, AVPacket *pkt) {
AVIOContext *pb = s->pb;
int ret, size;
- if (url_feof(pb))
+ if (pb->eof_reached)
return AVERROR(EIO);
size = avio_rb16(pb);
avio_rb16(pb); // unknown
diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c
index 328f901..7030491 100644
--- a/libavformat/dsicin.c
+++ b/libavformat/dsicin.c
@@ -147,7 +147,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) || url_ferror(pb))
+ if (pb->eof_reached || url_ferror(pb))
return AVERROR(EIO);
if (avio_rl32(pb) != 0xAA55AA55)
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 1e32125..9e67e71 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -412,7 +412,7 @@ static int dv_read_header(AVFormatContext *s,
state = avio_rb32(s->pb);
while ((state & 0xffffff7f) != 0x1f07003f) {
- if (url_feof(s->pb)) {
+ if (s->pb->eof_reached) {
av_log(s, AV_LOG_ERROR, "Cannot find DV header.\n");
return -1;
}
diff --git a/libavformat/dxa.c b/libavformat/dxa.c
index de72792..2c59986 100644
--- a/libavformat/dxa.c
+++ b/libavformat/dxa.c
@@ -104,7 +104,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
return -1;
ff_get_wav_header(pb, ast->codec, fsize);
// find 'data' chunk
- while(avio_tell(pb) < c->vidpos && !url_feof(pb)){
+ while(avio_tell(pb) < c->vidpos && !pb->eof_reached){
tag = avio_rl32(pb);
fsize = avio_rl32(pb);
if(tag == MKTAG('d', 'a', 't', 'a')) break;
@@ -162,7 +162,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(!s->pb->eof_reached && c->frames){
avio_read(s->pb, buf, 4);
switch(AV_RL32(buf)){
case MKTAG('N', 'U', 'L', 'L'):
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 4abf022..a43cfc8 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -109,7 +109,7 @@ static int process_audio_header_elements(AVFormatContext *s)
ea->sample_rate = -1;
ea->num_channels = 1;
- while (!url_feof(pb) && inHeader) {
+ while (!pb->eof_reached && inHeader) {
int inSubheader;
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");
inSubheader = 1;
- while (!url_feof(pb) && inSubheader) {
+ while (!pb->eof_reached && inSubheader) {
uint8_t subbyte;
subbyte = avio_r8(pb);
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 53eaa8e..1b5be16 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -91,7 +91,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 (s->pb->eof_reached) {
av_log(s, AV_LOG_ERROR, "cannot find FFM syncword\n");
return -1;
}
diff --git a/libavformat/ffmetadec.c b/libavformat/ffmetadec.c
index cc7e1da..ed65624 100644
--- a/libavformat/ffmetadec.c
+++ b/libavformat/ffmetadec.c
@@ -48,7 +48,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 (!s->eof_reached && (buf[0] == ';' || buf[0] == '#' || buf[0] == 0));
}
static AVChapter *read_chapter(AVFormatContext *s)
@@ -126,7 +126,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
AVMetadata **m = &s->metadata;
uint8_t line[1024];
- while(!url_feof(s->pb)) {
+ while(!s->pb->eof_reached) {
get_line(s->pb, line, sizeof(line));
if (!memcmp(line, ID_STREAM, strlen(ID_STREAM))) {
diff --git a/libavformat/filmstripdec.c b/libavformat/filmstripdec.c
index 8d56b0e..568bc0d 100644
--- a/libavformat/filmstripdec.c
+++ b/libavformat/filmstripdec.c
@@ -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 (s->pb->eof_reached)
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);
diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c
index 73eeacb..e935c3f 100644
--- a/libavformat/flacdec.c
+++ b/libavformat/flacdec.c
@@ -46,7 +46,7 @@ static int flac_read_header(AVFormatContext *s,
}
/* process metadata blocks */
- while (!url_feof(s->pb) && !metadata_last) {
+ while (!s->pb->eof_reached && !metadata_last) {
avio_read(s->pb, header, 4);
ff_flac_parse_block_header(header, &metadata_last, &metadata_type,
&metadata_size);
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 7e02cdd..bb27131 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -311,7 +311,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
dts = avio_rb24(s->pb);
dts |= avio_r8(s->pb) << 24;
// av_log(s, AV_LOG_DEBUG, "type:%d, size:%d, dts:%d\n", type, size, dts);
- if (url_feof(s->pb))
+ if (s->pb->eof_reached)
return AVERROR_EOF;
avio_seek(s->pb, 3, SEEK_CUR); /* stream id, always 0 */
flags = 0;
diff --git a/libavformat/gxf.c b/libavformat/gxf.c
index dc0272d..9e47249 100644
--- a/libavformat/gxf.c
+++ b/libavformat/gxf.c
@@ -368,7 +368,7 @@ static int gxf_header(AVFormatContext *s, AVFormatParameters *ap) {
#define READ_ONE() \
{ \
- if (!max_interval-- || url_feof(pb)) \
+ if (!max_interval-- || pb->eof_reached) \
goto out; \
tmp = tmp << 8 | avio_r8(pb); \
}
@@ -422,13 +422,13 @@ static int gxf_packet(AVFormatContext *s, AVPacket *pkt) {
AVIOContext *pb = s->pb;
GXFPktType pkt_type;
int pkt_len;
- while (!url_feof(pb)) {
+ while (!pb->eof_reached) {
AVStream *st;
int track_type, track_id, ret;
int field_nr, field_info, skip = 0;
int stream_index;
if (!parse_packet_header(pb, &pkt_type, &pkt_len)) {
- if (!url_feof(pb))
+ if (!pb->eof_reached)
av_log(s, AV_LOG_ERROR, "sync lost\n");
return -1;
}
diff --git a/libavformat/idcin.c b/libavformat/idcin.c
index 1aecf86..78e6caf 100644
--- a/libavformat/idcin.c
+++ b/libavformat/idcin.c
@@ -227,7 +227,7 @@ static int idcin_read_packet(AVFormatContext *s,
unsigned char r, g, b;
unsigned char palette_buffer[768];
- if (url_feof(s->pb))
+ if (s->pb->eof_reached)
return AVERROR(EIO);
if (idcin->next_chunk_is_video) {
diff --git a/libavformat/idroqdec.c b/libavformat/idroqdec.c
index 391db60..1feb236 100644
--- a/libavformat/idroqdec.c
+++ b/libavformat/idroqdec.c
@@ -111,7 +111,7 @@ static int roq_read_packet(AVFormatContext *s,
while (!packet_read) {
- if (url_feof(s->pb))
+ if (s->pb->eof_reached)
return AVERROR(EIO);
/* get the next chunk preamble */
diff --git a/libavformat/iff.c b/libavformat/iff.c
index dd69ce8..3e32934 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -138,7 +138,7 @@ static int iff_read_header(AVFormatContext *s,
// codec_tag used by ByteRun1 decoder to distinguish progressive (PBM) and interlaced (ILBM) content
st->codec->codec_tag = avio_rl32(pb);
- while(!url_feof(pb)) {
+ while(!pb->eof_reached) {
uint64_t orig_pos;
int res;
const char *metadata_tag = NULL;
diff --git a/libavformat/img2.c b/libavformat/img2.c
index c909078..44c53fc 100644
--- a/libavformat/img2.c
+++ b/libavformat/img2.c
@@ -287,7 +287,7 @@ static int 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 (f[0]->eof_reached)
return AVERROR(EIO);
size[0]= 4096;
}
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index b54df38..508a82b 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -225,7 +225,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 (pb->eof_reached)
return CHUNK_EOF;
if (avio_read(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
CHUNK_PREAMBLE_SIZE)
@@ -271,7 +271,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 (pb->eof_reached) {
chunk_type = CHUNK_EOF;
break;
}
@@ -532,7 +532,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 (pb->eof_reached)
return AVERROR_EOF;
}
/* initialize private context members */
diff --git a/libavformat/lxfdec.c b/libavformat/lxfdec.c
index 4e98c89..0d5d8e8 100644
--- a/libavformat/lxfdec.c
+++ b/libavformat/lxfdec.c
@@ -90,7 +90,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 (s->pb->eof_reached)
return AVERROR_EOF;
memmove(buf, &buf[1], LXF_IDENT_LENGTH-1);
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index ffb9d73..a356611 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -548,7 +548,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 (!pb->eof_reached) {
int64_t pos = avio_tell(pb);
av_log(matroska->ctx, AV_LOG_ERROR,
"Read error at pos. %"PRIu64" (0x%"PRIx64")\n",
diff --git a/libavformat/mmf.c b/libavformat/mmf.c
index 0f5cee4..be3f649 100644
--- a/libavformat/mmf.c
+++ b/libavformat/mmf.c
@@ -266,7 +266,7 @@ static int mmf_read_packet(AVFormatContext *s,
AVStream *st;
int ret, size;
- if (url_feof(s->pb))
+ if (s->pb->eof_reached)
return AVERROR(EIO);
st = s->streams[0];
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 34b5f8e..db79815 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -259,7 +259,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 && !pb->eof_reached) {
int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL;
a.size = atom.size;
a.type=0;
@@ -2411,7 +2411,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
mov->found_mdat = 0;
if (!url_is_streamed(s->pb) ||
mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
- url_feof(s->pb))
+ s->pb->eof_reached)
return AVERROR_EOF;
av_dlog(s, "read fragments, offset 0x%llx\n", avio_tell(s->pb));
goto retry;
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index b55bf49..a1615a8 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -200,7 +200,7 @@ static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap)
return -1;
}
- while(!url_feof(pb)){
+ while(!pb->eof_reached){
pos = avio_tell(pb);
mpc8_get_chunk_header(pb, &tag, &size);
if(tag == TAG_STREAMHDR)
@@ -247,7 +247,7 @@ static int mpc8_read_packet(AVFormatContext *s, AVPacket *pkt)
int tag;
int64_t pos, size;
- while(!url_feof(s->pb)){
+ while(!s->pb->eof_reached){
pos = avio_tell(s->pb);
mpc8_get_chunk_header(s->pb, &tag, &size);
if (size < 0)
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 740dbc9..7a93c63 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -143,7 +143,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 (pb->eof_reached)
break;
v = avio_r8(pb);
n--;
@@ -253,7 +253,7 @@ static int mpegps_read_pes_header(AVFormatContext *s,
last_sync = avio_tell(s->pb);
//printf("startcode=%x pos=0x%"PRIx64"\n", startcode, avio_tell(s->pb));
if (startcode < 0){
- if(url_feof(s->pb))
+ if(s->pb->eof_reached)
return AVERROR_EOF;
//FIXME we should remember header_state
return AVERROR(EAGAIN);
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 2b55de9..2e0fcb4 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1313,7 +1313,7 @@ static int mpegts_resync(AVFormatContext *s)
for(i = 0;i < MAX_RESYNC_SIZE; i++) {
c = avio_r8(pb);
- if (url_feof(pb))
+ if (pb->eof_reached)
return -1;
if (c == 0x47) {
avio_seek(pb, -1, SEEK_CUR);
diff --git a/libavformat/msnwc_tcp.c b/libavformat/msnwc_tcp.c
index 2a11a57..5af1c4e 100644
--- a/libavformat/msnwc_tcp.c
+++ b/libavformat/msnwc_tcp.c
@@ -88,9 +88,9 @@ static int msnwc_tcp_read_header(AVFormatContext *ctx, AVFormatParameters *ap)
/* 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 && !pb->eof_reached);
- if(url_feof(pb)) {
+ if(pb->eof_reached) {
av_log(ctx, AV_LOG_ERROR, "Could not find valid start.");
return -1;
}
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 19a632b..de91fce 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -179,7 +179,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 && !pb->eof_reached; i++) {
b = avio_r8(pb);
if (b == key[0])
i = 0;
@@ -305,7 +305,7 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
{
KLVPacket klv;
- while (!url_feof(s->pb)) {
+ while (!s->pb->eof_reached) {
if (klv_read_packet(&klv, s->pb) < 0)
return -1;
PRINT_KEY(s, "read packet", klv.key);
@@ -914,7 +914,7 @@ static int mxf_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
avio_seek(s->pb, -14, SEEK_CUR);
mxf->fc = s;
- while (!url_feof(s->pb)) {
+ while (!s->pb->eof_reached) {
const MXFMetadataReadTableEntry *metadata;
if (klv_read_packet(&klv, s->pb) < 0)
diff --git a/libavformat/mxg.c b/libavformat/mxg.c
index 81ffec6..3a71b22 100644
--- a/libavformat/mxg.c
+++ b/libavformat/mxg.c
@@ -132,7 +132,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) && !url_ferror(s->pb)){
+ while (!s->pb->eof_reached && !url_ferror(s->pb)){
if (mxg->cache_size <= OVERREAD_SIZE) {
/* update internal buffer */
ret = mxg_update_cache(s, DEFAULT_PACKET_SIZE + OVERREAD_SIZE);
diff --git a/libavformat/ncdec.c b/libavformat/ncdec.c
index 79a4dba..0c44aaa 100644
--- a/libavformat/ncdec.c
+++ b/libavformat/ncdec.c
@@ -66,7 +66,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 (s->pb->eof_reached)
return AVERROR(EIO);
state = (state<<8) + avio_r8(s->pb);
}
diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index 3bfebb2..1dc7cb0 100644
--- a/libavformat/nsvdec.c
+++ b/libavformat/nsvdec.c
@@ -230,7 +230,7 @@ static int nsv_resync(AVFormatContext *s)
//nsv->state = NSV_UNSYNC;
for (i = 0; i < NSV_MAX_RESYNC; i++) {
- if (url_feof(pb)) {
+ if (pb->eof_reached) {
av_dlog(s, "NSV EOF\n");
nsv->state = NSV_UNSYNC;
return -1;
@@ -296,7 +296,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap)
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 (pb->eof_reached)
return -1;
av_dlog(s, "NSV got header; filepos %"PRId64"\n", avio_tell(pb));
@@ -331,7 +331,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap)
}
av_free(strings);
}
- if (url_feof(pb))
+ if (pb->eof_reached)
return -1;
av_dlog(s, "NSV got infos; filepos %"PRId64"\n", avio_tell(pb));
@@ -378,7 +378,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap)
avio_seek(pb, nsv->base_offset + size, SEEK_SET); /* required for dumbdriving-271.nsv (2 extra bytes) */
- if (url_feof(pb))
+ if (pb->eof_reached)
return -1;
nsv->state = NSV_HAS_READ_NSVF;
return 0;
@@ -554,7 +554,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 (pb->eof_reached)
return -1;
for (i = 0; i < NSV_MAX_RESYNC_TRIES && nsv->state < NSV_FOUND_NSVS && !err; i++)
@@ -588,7 +588,7 @@ null_chunk_retry:
vsize -= auxsize + sizeof(uint16_t) + sizeof(uint32_t); /* that's becoming braindead */
}
- if (url_feof(pb))
+ if (pb->eof_reached)
return -1;
if (!vsize && !asize) {
nsv->state = NSV_UNSYNC;
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 107ff68..d31040e 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -121,7 +121,7 @@ static uint64_t find_any_startcode(AVIOContext *bc, int64_t pos){
if(pos >= 0)
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)){
+ while(!bc->eof_reached){
state= (state<<8) | avio_r8(bc);
if((state>>56) != 'N')
continue;
@@ -790,7 +790,7 @@ static int nut_read_packet(AVFormatContext *s, AVPacket *pkt)
pos-=8;
}else{
frame_code = avio_r8(bc);
- if(url_feof(bc))
+ if(bc->eof_reached)
return -1;
if(frame_code == 'N'){
tmp= frame_code;
diff --git a/libavformat/nuv.c b/libavformat/nuv.c
index 6f4a031..bd2e281 100644
--- a/libavformat/nuv.c
+++ b/libavformat/nuv.c
@@ -60,7 +60,7 @@ static int get_codec_data(AVIOContext *pb, AVStream *vst,
nuv_frametype frametype;
if (!vst && !myth)
return 1; // no codec data needed
- while (!url_feof(pb)) {
+ while (!pb->eof_reached) {
int size, subtype;
frametype = avio_r8(pb);
switch (frametype) {
@@ -195,7 +195,7 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) {
uint8_t hdr[HDRSIZE];
nuv_frametype frametype;
int ret, size;
- while (!url_feof(pb)) {
+ while (!pb->eof_reached) {
int copyhdrsize = ctx->rtjpg_video ? HDRSIZE : 0;
uint64_t pos = avio_tell(pb);
ret = avio_read(pb, hdr, HDRSIZE);
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 379de7e..76ef19a 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -219,7 +219,7 @@ ogg_read_page (AVFormatContext * s, int *str)
break;
c = avio_r8(bc);
- if (url_feof(bc))
+ if (bc->eof_reached)
return -1;
sync[sp++ & 3] = c;
}while (i++ < MAX_PAGE_SIZE);
diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c
index 744ae94..3b0780b 100644
--- a/libavformat/psxstr.c
+++ b/libavformat/psxstr.c
@@ -241,7 +241,7 @@ static int str_read_packet(AVFormatContext *s,
break;
}
- if (url_feof(pb))
+ if (pb->eof_reached)
return AVERROR(EIO);
}
}
diff --git a/libavformat/qcp.c b/libavformat/qcp.c
index fefc929..b58ae33 100644
--- a/libavformat/qcp.c
+++ b/libavformat/qcp.c
@@ -140,7 +140,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(!pb->eof_reached) {
if (c->data_size) {
int pkt_size, ret, mode = avio_r8(pb);
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index e2e9b02..4fd2e86 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -409,7 +409,7 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap)
avio_rb32(pb); /* number of headers */
for(;;) {
- if (url_feof(pb))
+ if (pb->eof_reached)
return -1;
tag = avio_rl32(pb);
tag_size = avio_rb32(pb);
@@ -515,7 +515,7 @@ static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_
AVStream *st;
uint32_t state=0xFFFFFFFF;
- while(!url_feof(pb)){
+ while(!pb->eof_reached){
int len, num, i;
*pos= avio_tell(pb) - 3;
if(rm->remaining_len > 0){
@@ -848,7 +848,7 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
st = s->streams[i];
}
- if(len<0 || url_feof(s->pb))
+ if(len<0 || s->pb->eof_reached)
return AVERROR(EIO);
res = ff_rm_parse_packet (s, s->pb, st, st->priv_data, len, pkt,
diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 2603a4d..5fc6e58 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -235,7 +235,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
int palchange = 0;
int pos;
- if (url_feof(s->pb) || smk->cur_frame >= smk->frames)
+ if (s->pb->eof_reached || smk->cur_frame >= smk->frames)
return AVERROR_EOF;
/* if we demuxed all streams, pass another frame */
diff --git a/libavformat/sol.c b/libavformat/sol.c
index 7ad894e..2a3b40c 100644
--- a/libavformat/sol.c
+++ b/libavformat/sol.c
@@ -130,7 +130,7 @@ static int sol_read_packet(AVFormatContext *s,
{
int ret;
- if (url_feof(s->pb))
+ if (s->pb->eof_reached)
return AVERROR(EIO);
ret= av_get_packet(s->pb, pkt, MAX_SIZE);
pkt->stream_index = 0;
diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c
index 6d99033..293e846 100644
--- a/libavformat/soxdec.c
+++ b/libavformat/soxdec.c
@@ -127,7 +127,7 @@ static int sox_read_packet(AVFormatContext *s,
{
int ret, size;
- if (url_feof(s->pb))
+ if (s->pb->eof_reached)
return AVERROR_EOF;
size = SOX_SAMPLES*s->streams[0]->codec->block_align;
diff --git a/libavformat/spdifdec.c b/libavformat/spdifdec.c
index 8a6b79d..0ca6611 100644
--- a/libavformat/spdifdec.c
+++ b/libavformat/spdifdec.c
@@ -171,7 +171,7 @@ static int 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 (pb->eof_reached)
return AVERROR_EOF;
}
diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index 0a94a7f..3572add 100644
--- a/libavformat/srtdec.c
+++ b/libavformat/srtdec.c
@@ -81,7 +81,7 @@ static int srt_read_packet(AVFormatContext *s, AVPacket *pkt)
do {
ptr2 = ptr;
ptr += ff_get_line(s->pb, ptr, sizeof(buffer)+buffer-ptr);
- } while (!is_eol(*ptr2) && !url_feof(s->pb) && ptr-buffer<sizeof(buffer)-1);
+ } while (!is_eol(*ptr2) && !s->pb->eof_reached && ptr-buffer<sizeof(buffer)-1);
if (buffer[0] && !(res = av_new_packet(pkt, ptr-buffer))) {
memcpy(pkt->data, buffer, pkt->size);
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index c63052c..57eb233 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -27,7 +27,7 @@ static int get_swf_tag(AVIOContext *pb, int *len_ptr)
{
int tag, len;
- if (url_feof(pb))
+ if (pb->eof_reached)
return -1;
tag = avio_rl16(pb);
diff --git a/libavformat/tmv.c b/libavformat/tmv.c
index c632988..1116ca0 100644
--- a/libavformat/tmv.c
+++ b/libavformat/tmv.c
@@ -146,7 +146,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 (pb->eof_reached)
return AVERROR_EOF;
ret = av_get_packet(pb, pkt, pkt_size);
diff --git a/libavformat/tty.c b/libavformat/tty.c
index 71c00e7..8af245a 100644
--- a/libavformat/tty.c
+++ b/libavformat/tty.c
@@ -106,7 +106,7 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
TtyDemuxContext *s = avctx->priv_data;
int n;
- if (url_feof(avctx->pb))
+ if (avctx->pb->eof_reached)
return AVERROR_EOF;
n = s->chars_per_frame;
diff --git a/libavformat/txd.c b/libavformat/txd.c
index 22dcfdb..b62a7dc 100644
--- a/libavformat/txd.c
+++ b/libavformat/txd.c
@@ -61,7 +61,7 @@ next_chunk:
chunk_size = avio_rl32(pb);
marker = avio_rl32(pb);
- if (url_feof(s->pb))
+ if (s->pb->eof_reached)
return AVERROR_EOF;
if (marker != TXD_MARKER && marker != TXD_MARKER2) {
av_log(s, AV_LOG_ERROR, "marker does not match\n");
diff --git a/libavformat/vc1test.c b/libavformat/vc1test.c
index 2f84b52..54d96f5 100644
--- a/libavformat/vc1test.c
+++ b/libavformat/vc1test.c
@@ -92,7 +92,7 @@ static int vc1t_read_packet(AVFormatContext *s,
int keyframe = 0;
uint32_t pts;
- if(url_feof(pb))
+ if(pb->eof_reached)
return AVERROR(EIO);
frame_size = avio_rl24(pb);
diff --git a/libavformat/wav.c b/libavformat/wav.c
index 8023a79..d51c012 100644
--- a/libavformat/wav.c
+++ b/libavformat/wav.c
@@ -155,7 +155,7 @@ static int64_t find_tag(AVIOContext *pb, uint32_t tag1)
int64_t size;
for (;;) {
- if (url_feof(pb))
+ if (pb->eof_reached)
return -1;
size = next_tag(pb, &tag);
if (tag == tag1)
@@ -234,7 +234,7 @@ static int wav_read_header(AVFormatContext *s,
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
for (;;) {
- if (url_feof(pb))
+ if (pb->eof_reached)
return -1;
size = next_tag(pb, &tag);
if (tag == MKTAG('d', 'a', 't', 'a')){
@@ -269,7 +269,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 (!pb->eof_reached) {
avio_read(pb, guid, 16);
size = avio_rl64(pb);
if (size <= 24)
diff --git a/libavformat/wc3movie.c b/libavformat/wc3movie.c
index a4dd26b..e4c871c 100644
--- a/libavformat/wc3movie.c
+++ b/libavformat/wc3movie.c
@@ -157,7 +157,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 (pb->eof_reached)
return AVERROR(EIO);
} while (fourcc_tag != BRCH_TAG);
@@ -208,7 +208,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 (pb->eof_reached)
return AVERROR(EIO);
switch (fourcc_tag) {
diff --git a/libavformat/wtv.c b/libavformat/wtv.c
index ade4a42..2b3737b 100644
--- a/libavformat/wtv.c
+++ b/libavformat/wtv.c
@@ -79,7 +79,7 @@ static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size)
if (wf->error || url_ferror(pb))
return -1;
- if (wf->position >= wf->length || url_feof(pb))
+ if (wf->position >= wf->length || pb->eof_reached)
return 0;
buf_size = FFMIN(buf_size, wf->length - wf->position);
@@ -554,7 +554,7 @@ static void parse_legacy_attrib(AVFormatContext *s, AVIOContext *pb)
{
ff_asf_guid guid;
int length, type;
- while(!url_feof(pb)) {
+ while(!pb->eof_reached) {
char key[1024];
ff_get_guid(pb, &guid);
type = avio_rl32(pb);
@@ -770,7 +770,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 (!pb->eof_reached) {
ff_asf_guid g;
int len, sid, consumed;
@@ -997,7 +997,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
while(1) {
uint64_t timestamp = avio_rl64(pb);
uint64_t frame_nb = avio_rl64(pb);
- if (url_feof(pb))
+ if (pb->eof_reached)
break;
ff_add_index_entry(&wtv->index_entries, &wtv->nb_index_entries, &wtv->index_entries_allocated_size,
0, timestamp, frame_nb, 0, AVINDEX_KEYFRAME);
@@ -1011,7 +1011,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
while (1) {
uint64_t frame_nb = avio_rl64(pb);
uint64_t position = avio_rl64(pb);
- if (url_feof(pb))
+ if (pb->eof_reached)
break;
for (i = wtv->nb_index_entries - 1; i >= 0; i--) {
AVIndexEntry *e = wtv->index_entries + i;
diff --git a/libavformat/wv.c b/libavformat/wv.c
index 1b6061c..12aaef9 100644
--- a/libavformat/wv.c
+++ b/libavformat/wv.c
@@ -241,7 +241,7 @@ static int wv_read_packet(AVFormatContext *s,
int ret;
int size, ver, off;
- if (url_feof(s->pb))
+ if (s->pb->eof_reached)
return AVERROR(EIO);
if(wc->block_parsed){
if(wv_read_block_header(s, s->pb, 0) < 0)
--
1.7.4.1
More information about the ffmpeg-devel
mailing list