aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-03-07 21:50:25 +0100
committerRonald S. Bultje <rsbultje@gmail.com>2011-03-07 17:20:31 -0500
commit66e5b1df360a28b083bc9ec5a76e7add5f40ce1f (patch)
tree2de95f70d35fd95832de9db9c1061270dcf8ae19
parent6a7e074eb98c4d45898d7f2920312db6899ee650 (diff)
downloadffmpeg-66e5b1df360a28b083bc9ec5a76e7add5f40ce1f.tar.gz
avio: deprecate url_feof
AVIOContext.eof_reached should be used directly instead. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
-rw-r--r--ffplay.c2
-rw-r--r--libavformat/4xm.c2
-rw-r--r--libavformat/aiffdec.c2
-rw-r--r--libavformat/amr.c2
-rw-r--r--libavformat/anm.c2
-rw-r--r--libavformat/ape.c2
-rw-r--r--libavformat/applehttp.c4
-rw-r--r--libavformat/applehttpproto.c2
-rw-r--r--libavformat/asfdec.c12
-rw-r--r--libavformat/assdec.c2
-rw-r--r--libavformat/avidec.c12
-rw-r--r--libavformat/avio.h11
-rw-r--r--libavformat/aviobuf.c10
-rw-r--r--libavformat/bethsoftvid.c2
-rw-r--r--libavformat/bfi.c4
-rw-r--r--libavformat/cafdec.c6
-rw-r--r--libavformat/daud.c2
-rw-r--r--libavformat/dsicin.c2
-rw-r--r--libavformat/dv.c2
-rw-r--r--libavformat/dxa.c4
-rw-r--r--libavformat/electronicarts.c4
-rw-r--r--libavformat/ffmdec.c2
-rw-r--r--libavformat/ffmetadec.c4
-rw-r--r--libavformat/filmstripdec.c2
-rw-r--r--libavformat/flacdec.c2
-rw-r--r--libavformat/flvdec.c2
-rw-r--r--libavformat/gxf.c6
-rw-r--r--libavformat/idcin.c2
-rw-r--r--libavformat/idroqdec.c2
-rw-r--r--libavformat/iff.c2
-rw-r--r--libavformat/img2.c2
-rw-r--r--libavformat/ipmovie.c6
-rw-r--r--libavformat/lxfdec.c2
-rw-r--r--libavformat/matroskadec.c2
-rw-r--r--libavformat/mmf.c2
-rw-r--r--libavformat/mov.c4
-rw-r--r--libavformat/mpc8.c4
-rw-r--r--libavformat/mpeg.c4
-rw-r--r--libavformat/mpegts.c2
-rw-r--r--libavformat/msnwc_tcp.c4
-rw-r--r--libavformat/mxfdec.c6
-rw-r--r--libavformat/mxg.c2
-rw-r--r--libavformat/ncdec.c2
-rw-r--r--libavformat/nsvdec.c12
-rw-r--r--libavformat/nutdec.c4
-rw-r--r--libavformat/nuv.c4
-rw-r--r--libavformat/oggdec.c2
-rw-r--r--libavformat/psxstr.c2
-rw-r--r--libavformat/qcp.c2
-rw-r--r--libavformat/rmdec.c6
-rw-r--r--libavformat/smacker.c2
-rw-r--r--libavformat/sol.c2
-rw-r--r--libavformat/soxdec.c2
-rw-r--r--libavformat/spdifdec.c2
-rw-r--r--libavformat/srtdec.c2
-rw-r--r--libavformat/swfdec.c2
-rw-r--r--libavformat/tmv.c2
-rw-r--r--libavformat/tty.c2
-rw-r--r--libavformat/txd.c2
-rw-r--r--libavformat/vc1test.c2
-rw-r--r--libavformat/wav.c6
-rw-r--r--libavformat/wc3movie.c4
-rw-r--r--libavformat/wtv.c10
-rw-r--r--libavformat/wv.c2
64 files changed, 116 insertions, 115 deletions
diff --git a/ffplay.c b/ffplay.c
index e304aab3b1..60194372d9 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 ed722805b2..95bd717915 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 9e3d39c371..8506d8b5c8 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 9d6581dee5..522d83ea8b 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 2a0109d1de..980920f52a 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 2de47ef483..6c269849fd 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 5118d03670..c1609b895d 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 471f94bd2a..83071300e8 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 e3a38073e8..10d34499c7 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 e04d92ae65..abaf942f45 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 83b86d8146..8181298959 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 8bae263833..2949629d57 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 7762d6cace..d0f63df3d2 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 7987e8e6f6..0b45115f0c 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 21676e440a..cec02fd646 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 9db7608ddd..ec3054ff2b 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 39a994b605..f852105a0c 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 328f901463..7030491992 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 1e32125c23..9e67e710b5 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 de72792372..2c599865bb 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 4abf0223e2..a43cfc8d66 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 53eaa8e6f7..1b5be16ff7 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 cc7e1da48f..ed65624520 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 8d56b0e340..568bc0d17a 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 73eeacb422..e935c3f168 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 7e02cdd3b4..bb27131cfd 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 dc0272d5c3..9e47249152 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 1aecf86669..78e6caf1ca 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 391db609b7..1feb236188 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 dd69ce8ca5..3e329343a4 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 c909078ecf..44c53fc18c 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 b54df38b23..508a82b6be 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 4e98c895cf..0d5d8e8f91 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 ffb9d73d3c..a356611930 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 0f5cee4f71..be3f649b41 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 34b5f8e754..db798154a0 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 b55bf49650..a1615a835b 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 740dbc94c0..7a93c637f7 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 a1446d839f..ea41d81c11 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1329,7 +1329,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 2a11a57201..5af1c4e0ad 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 19a632b01a..de91fce755 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 81ffec6971..3a71b22054 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 79a4dbafab..0c44aaa5be 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 3bfebb263c..1dc7cb0869 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 107ff6815f..d31040efb8 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 6f4a03192d..bd2e28145e 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 379de7eac1..76ef19ada3 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 744ae94459..3b0780b6ea 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 fefc929279..b58ae33579 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 e2e9b0298c..4fd2e86759 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 2603a4d71c..5fc6e58e59 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 7ad894e304..2a3b40c02b 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 6d99033f47..293e8463a3 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 8a6b79dd52..0ca66118f0 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 0a94a7f518..3572add0dd 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 c63052c66c..57eb233b35 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 c632988e18..1116ca0369 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 71c00e7e0a..8af245ae60 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 22dcfdbe77..b62a7dcbf6 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 2f84b52674..54d96f57d7 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 8023a791f3..d51c01208e 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 a4dd26b442..e4c871ca09 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 ade4a42e1b..2b3737bc84 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 1b6061ce43..12aaef991b 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)