[FFmpeg-devel] [PATCH 1/2] avio: add an inline avio_eof function as a replacement for url_feof
Anton Khirnov
anton
Fri Mar 4 20:33:00 CET 2011
---
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/asfdec.c | 12 ++++++------
libavformat/assdec.c | 2 +-
libavformat/avidec.c | 12 ++++++------
libavformat/avio.h | 6 +++++-
libavformat/aviobuf.c | 6 ++++--
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/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/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 +-
61 files changed, 111 insertions(+), 105 deletions(-)
diff --git a/ffplay.c b/ffplay.c
index e304aab..d5a0219 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 || avio_eof(ic->pb))
eof=1;
if (url_ferror(ic->pb))
break;
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index ed72280..3752031 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 (avio_eof(pb))
return AVERROR(EIO);
switch (fourcc_tag) {
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 9e3d39c..0826333 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 (avio_eof(pb))
return AVERROR(EIO);
*tag = avio_rl32(pb);
diff --git a/libavformat/amr.c b/libavformat/amr.c
index 9d6581d..37a495f 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 (avio_eof(s->pb))
{
return AVERROR(EIO);
}
diff --git a/libavformat/anm.c b/libavformat/anm.c
index 2a0109d..33d7feb 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 (avio_eof(s->pb))
return AVERROR(EIO);
if (anm->page < 0)
diff --git a/libavformat/ape.c b/libavformat/ape.c
index 2de47ef..eba3824 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 (avio_eof(s->pb))
return AVERROR(EIO);
if (ape->currentframe > ape->totalframes)
return AVERROR(EIO);
diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c
index 5118d03..eccc9e3 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 (!avio_eof(in)) {
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 (!avio_eof(var->pb))
return ret;
reset_packet(&var->pkt);
}
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index e3a3807..974be9a 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 (avio_eof(pb)) {
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 (avio_eof(pb))
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 (!avio_eof(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_eof(pb))
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(avio_eof(pb))
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 || avio_eof(s->pb)) {
avio_seek(s->pb, current_pos, SEEK_SET);
return;
}
diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index e04d92a..0518b38 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(!avio_eof(pb)){
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..be5e1db 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(avio_eof(pb))
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(avio_eof(pb))
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 (avio_eof(pb))
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); !avio_eof(pb); 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(avio_eof(pb))
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 (avio_eof(pb))
break;
tag = avio_rl32(pb);
size = avio_rl32(pb);
diff --git a/libavformat/avio.h b/libavformat/avio.h
index e71389a..230fa0e 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -424,6 +424,7 @@ attribute_deprecated int64_t url_fseek(AVIOContext *s, int64_t offset, int whenc
attribute_deprecated int url_fskip(AVIOContext *s, int64_t offset);
attribute_deprecated int64_t url_ftell(AVIOContext *s);
attribute_deprecated int64_t url_fsize(AVIOContext *s);
+attribute_deprecated int url_feof(AVIOContext *s);
/**
* @}
*/
@@ -487,7 +488,10 @@ 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);
+static av_always_inline int avio_eof(AVIOContext *s)
+{
+ return s ? s->eof_reached : 0;
+}
int url_ferror(AVIOContext *s);
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 5a9dab7..34b7f71 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)
{
@@ -596,7 +598,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 (avio_eof(s)) return AVERROR_EOF;
}
return size1 - size;
}
@@ -619,7 +621,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 (avio_eof(s)) return AVERROR_EOF;
}
return len;
}
diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c
index 7987e8e..25cbdd4 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 || avio_eof(pb))
return AVERROR(EIO);
block_type = avio_r8(pb);
diff --git a/libavformat/bfi.c b/libavformat/bfi.c
index 21676e4..fcf5c33 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 || avio_eof(pb)) {
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 (avio_eof(pb))
return AVERROR(EIO);
state = 256*state + avio_r8(pb);
}
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 9db7608..b3b8184 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 (!avio_eof(pb)) {
/* 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 (avio_eof(pb))
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 (avio_eof(pb))
return AVERROR(EIO);
/* don't read past end of data chunk */
diff --git a/libavformat/daud.c b/libavformat/daud.c
index 39a994b..6a2f0bd 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 (avio_eof(pb))
return AVERROR(EIO);
size = avio_rb16(pb);
avio_rb16(pb); // unknown
diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c
index 328f901..ab211e5 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 (avio_eof(pb) || url_ferror(pb))
return AVERROR(EIO);
if (avio_rl32(pb) != 0xAA55AA55)
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 1e32125..c11a864 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 (avio_eof(s->pb)) {
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..af1d2d8 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 && !avio_eof(pb)){
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(!avio_eof(s->pb) && 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..1f63ec4 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 (!avio_eof(pb) && 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 (!avio_eof(pb) && inSubheader) {
uint8_t subbyte;
subbyte = avio_r8(pb);
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 53eaa8e..a4b7bb9 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 (avio_eof(s->pb)) {
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..f2ce6c6 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 (!avio_eof(s) && (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(!avio_eof(s->pb)) {
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..6530edb 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 (avio_eof(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);
diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c
index 73eeacb..5ef9318 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 (!avio_eof(s->pb) && !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..d7f6c3c 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 (avio_eof(s->pb))
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..4864c79 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-- || avio_eof(pb)) \
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 (!avio_eof(pb)) {
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 (!avio_eof(pb))
av_log(s, AV_LOG_ERROR, "sync lost\n");
return -1;
}
diff --git a/libavformat/idcin.c b/libavformat/idcin.c
index 1aecf86..ff38269 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 (avio_eof(s->pb))
return AVERROR(EIO);
if (idcin->next_chunk_is_video) {
diff --git a/libavformat/idroqdec.c b/libavformat/idroqdec.c
index 391db60..985deef 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 (avio_eof(s->pb))
return AVERROR(EIO);
/* get the next chunk preamble */
diff --git a/libavformat/iff.c b/libavformat/iff.c
index dd69ce8..0838dc0 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(!avio_eof(pb)) {
uint64_t orig_pos;
int res;
const char *metadata_tag = NULL;
diff --git a/libavformat/img2.c b/libavformat/img2.c
index c909078..0b71435 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 (avio_eof(f[0]))
return AVERROR(EIO);
size[0]= 4096;
}
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index b54df38..efb9da9 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 (avio_eof(pb))
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 (avio_eof(pb)) {
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 (avio_eof(pb))
return AVERROR_EOF;
}
/* initialize private context members */
diff --git a/libavformat/lxfdec.c b/libavformat/lxfdec.c
index 4e98c89..ed77534 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 (avio_eof(s->pb))
return AVERROR_EOF;
memmove(buf, &buf[1], LXF_IDENT_LENGTH-1);
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index ffb9d73..791f26f 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 (!avio_eof(pb)) {
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..2fa06cd 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 (avio_eof(s->pb))
return AVERROR(EIO);
st = s->streams[0];
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 34b5f8e..22a3832 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 && !avio_eof(pb)) {
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))
+ avio_eof(s->pb))
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..ec2c863 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(!avio_eof(pb)){
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(!avio_eof(s->pb)){
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..d2bb17c 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 (avio_eof(pb))
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(avio_eof(s->pb))
return AVERROR_EOF;
//FIXME we should remember header_state
return AVERROR(EAGAIN);
diff --git a/libavformat/msnwc_tcp.c b/libavformat/msnwc_tcp.c
index 2a11a57..b8c4465 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 && !avio_eof(pb));
- if(url_feof(pb)) {
+ if(avio_eof(pb)) {
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..df221cd 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 && !avio_eof(pb); 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 (!avio_eof(s->pb)) {
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 (!avio_eof(s->pb)) {
const MXFMetadataReadTableEntry *metadata;
if (klv_read_packet(&klv, s->pb) < 0)
diff --git a/libavformat/mxg.c b/libavformat/mxg.c
index 81ffec6..b85d434 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 (!avio_eof(s->pb) && !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..70f2ab3 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 (avio_eof(s->pb))
return AVERROR(EIO);
state = (state<<8) + avio_r8(s->pb);
}
diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index 3bfebb2..45a2a61 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 (avio_eof(pb)) {
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 (avio_eof(pb))
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 (avio_eof(pb))
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 (avio_eof(pb))
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 (avio_eof(pb))
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 (avio_eof(pb))
return -1;
if (!vsize && !asize) {
nsv->state = NSV_UNSYNC;
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 107ff68..89e1c2f 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(!avio_eof(bc)){
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(avio_eof(bc))
return -1;
if(frame_code == 'N'){
tmp= frame_code;
diff --git a/libavformat/nuv.c b/libavformat/nuv.c
index 6f4a031..2dbcdf1 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 (!avio_eof(pb)) {
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 (!avio_eof(pb)) {
int copyhdrsize = ctx->rtjpg_video ? HDRSIZE : 0;
uint64_t pos = avio_tell(pb);
ret = avio_read(pb, hdr, HDRSIZE);
diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c
index 744ae94..8c6e632 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 (avio_eof(pb))
return AVERROR(EIO);
}
}
diff --git a/libavformat/qcp.c b/libavformat/qcp.c
index fefc929..aa1525f 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(!avio_eof(pb)) {
if (c->data_size) {
int pkt_size, ret, mode = avio_r8(pb);
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index e2e9b02..a900deb 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 (avio_eof(pb))
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(!avio_eof(pb)){
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 || avio_eof(s->pb))
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..72fd680 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 (avio_eof(s->pb) || 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..48d993a 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 (avio_eof(s->pb))
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..aa5393d 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 (avio_eof(s->pb))
return AVERROR_EOF;
size = SOX_SAMPLES*s->streams[0]->codec->block_align;
diff --git a/libavformat/spdifdec.c b/libavformat/spdifdec.c
index 8a6b79d..84a3983 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 (avio_eof(pb))
return AVERROR_EOF;
}
diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index 0a94a7f..5d9244d 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) && !avio_eof(s->pb) && 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..a51bd24 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 (avio_eof(pb))
return -1;
tag = avio_rl16(pb);
diff --git a/libavformat/tmv.c b/libavformat/tmv.c
index c632988..ae97e6c 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 (avio_eof(pb))
return AVERROR_EOF;
ret = av_get_packet(pb, pkt, pkt_size);
diff --git a/libavformat/tty.c b/libavformat/tty.c
index 71c00e7..164beec 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 (avio_eof(avctx->pb))
return AVERROR_EOF;
n = s->chars_per_frame;
diff --git a/libavformat/txd.c b/libavformat/txd.c
index 22dcfdb..4a9e882 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 (avio_eof(s->pb))
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..917e6dd 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(avio_eof(pb))
return AVERROR(EIO);
frame_size = avio_rl24(pb);
diff --git a/libavformat/wav.c b/libavformat/wav.c
index 8023a79..d3c7521 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 (avio_eof(pb))
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 (avio_eof(pb))
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 (!avio_eof(pb)) {
avio_read(pb, guid, 16);
size = avio_rl64(pb);
if (size <= 24)
diff --git a/libavformat/wc3movie.c b/libavformat/wc3movie.c
index a4dd26b..c3e8078 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 (avio_eof(pb))
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 (avio_eof(pb))
return AVERROR(EIO);
switch (fourcc_tag) {
diff --git a/libavformat/wtv.c b/libavformat/wtv.c
index ade4a42..7601162 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 || avio_eof(pb))
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(!avio_eof(pb)) {
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 (!avio_eof(pb)) {
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 (avio_eof(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);
@@ -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 (avio_eof(pb))
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..1c9039d 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 (avio_eof(s->pb))
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