av_freep(&opts);
if (ic->pb)
- ic->pb->eof_reached = 0; // FIXME hack, ffplay maybe should not use url_feof() to test for the end
+ ic->pb->eof_reached = 0; // FIXME hack, ffplay maybe should not use avio_feof() to test for the end
if (seek_by_bytes < 0)
seek_by_bytes = !!(ic->iformat->flags & AVFMT_TS_DISCONT) && strcmp("ogg", ic->iformat->name);
}
ret = av_read_frame(ic, pkt);
if (ret < 0) {
- if (ret == AVERROR_EOF || url_feof(ic->pb))
+ if (ret == AVERROR_EOF || avio_feof(ic->pb))
eof = 1;
if (ic->pb && ic->pb->error)
break;
return ret;
fourcc_tag = AV_RL32(&header[0]);
size = AV_RL32(&header[4]);
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR(EIO);
switch (fourcc_tag) {
case LIST_TAG:
{
int ret, size = 1024;
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR_EOF;
ret = av_get_packet(s->pb, pkt, size);
{
int size;
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR(EIO);
*tag = avio_rl32(pb);
int64_t pos = avio_tell(s->pb);
AMRContext *amr = s->priv_data;
- if (url_feof(s->pb)) {
+ if (avio_feof(s->pb)) {
return AVERROR(EIO);
}
Page *p;
int tmp, record_size;
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR(EIO);
if (anm->page < 0)
APEContext *ape = s->priv_data;
uint32_t extra_size = 8;
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR_EOF;
if (ape->currentframe >= ape->totalframes)
return AVERROR_EOF;
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codec->codec_id = AV_CODEC_ID_TEXT;
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
char line[4096];
int len = ff_get_line(s->pb, line, sizeof(line));
continue;
} else if (!ff_guidcmp(&g, &ff_asf_marker_header)) {
asf_read_marker(s, gsize);
- } else if (url_feof(pb)) {
+ } else if (avio_feof(pb)) {
return AVERROR_EOF;
} else {
if (!s->keylen) {
avio_rl64(pb);
avio_r8(pb);
avio_r8(pb);
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
asf->data_offset = avio_tell(pb);
asf->packet_size_left = 0;
* the stream. */
if (pb->error == AVERROR(EAGAIN))
return AVERROR(EAGAIN);
- if (!url_feof(pb))
+ if (!avio_feof(pb))
av_log(s, AV_LOG_ERROR,
"ff asf bad header %x at:%"PRId64"\n", c, avio_tell(pb));
}
if ((c & 0x8f) == 0x82) {
if (d || e) {
- if (!url_feof(pb))
+ if (!avio_feof(pb))
av_log(s, AV_LOG_ERROR, "ff asf bad non zero\n");
return AVERROR_INVALIDDATA;
}
c = avio_r8(pb);
d = avio_r8(pb);
rsize += 3;
- } else if(!url_feof(pb)) {
+ } else if(!avio_feof(pb)) {
avio_seek(pb, -1, SEEK_CUR); // FIXME
}
ASFStream *asf_st = 0;
for (;;) {
int ret;
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
if (asf->packet_size_left < FRAME_HEADER_SIZE ||
asf->packet_segments < 1 && asf->packet_time_start == 0) {
* skip them until the simple index object is reached */
while (ff_guidcmp(&g, &ff_asf_simple_index_header)) {
int64_t gsize = avio_rl64(s->pb);
- if (gsize < 24 || url_feof(s->pb)) {
+ if (gsize < 24 || avio_feof(s->pb)) {
goto end;
}
avio_skip(s->pb, gsize - 24);
asf->index_read = ict > 1;
}
end:
-// if (url_feof(s->pb)) {
+// if (avio_feof(s->pb)) {
// ret = 0;
// }
avio_seek(s->pb, current_pos, SEEK_SET);
int64_t pos;
int ret;
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR_EOF;
pos = avio_tell(s->pb);
#ifdef DEBUG_SEEK
av_log(s, AV_LOG_ERROR, "pos:%"PRId64", len:%X\n", pos, len);
#endif
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_INVALIDDATA;
if (last_pos == pos || pos == base - 8)
avio_rl32(pb); /* size */
duration = avio_rl32(pb);
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_INVALIDDATA;
pos = avio_tell(pb);
codec_type = -1;
frame_period = 0;
for (;;) {
- if (url_feof(pb))
+ if (avio_feof(pb))
goto fail;
tag = avio_rl32(pb);
size = avio_rl32(pb);
start_sync:
memset(d, -1, sizeof(d));
- for (i = sync = avio_tell(pb); !url_feof(pb); i++) {
+ for (i = sync = avio_tell(pb); !avio_feof(pb); i++) {
int j;
for (j = 0; j < 7; j++)
/* Read the entries and sort them in each stream component. */
for (i = 0; i < nb_index_entries; i++) {
- if (url_feof(pb))
+ if (avio_feof(pb))
return -1;
tag = avio_rl32(pb);
for (;;) {
tag = avio_rl32(pb);
size = avio_rl32(pb);
- if (url_feof(pb))
+ if (avio_feof(pb))
break;
next = avio_tell(pb) + size + (size & 1);
int audio_length;
int ret_value;
- if(vid->is_finished || url_feof(pb))
+ if(vid->is_finished || avio_feof(pb))
return AVERROR_EOF;
block_type = avio_r8(pb);
BFIContext *bfi = s->priv_data;
AVIOContext *pb = s->pb;
int ret, audio_offset, video_offset, chunk_size, audio_size = 0;
- if (bfi->nframes == 0 || url_feof(pb)) {
+ if (bfi->nframes == 0 || avio_feof(pb)) {
return AVERROR_EOF;
}
if (!bfi->avflag) {
uint32_t state = 0;
while(state != MKTAG('S','A','V','I')){
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR(EIO);
state = 256*state + avio_r8(pb);
}
return AVERROR(EIO);
bin->fsize = -1; /* done */
} else if (!bin->fsize) {
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR(EIO);
if (av_get_packet(s->pb, pkt, bin->chars_per_frame) < 0)
return AVERROR(EIO);
int i, j, ret;
int64_t pos= avio_tell(pb);
- if(url_feof(pb))
+ if(avio_feof(pb))
return AVERROR_EOF;
avio_rl16(pb); // sync word
}
avio_skip(s->pb, size - (avio_tell(s->pb) - pos));
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
chunk = avio_rl32(s->pb);
size = avio_rb32(s->pb);
if (size < 8) {
uint32_t samples, size;
int ret;
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR_EOF;
b->current_block++;
if (b->current_block == b->block_count) {
/* parse each chunk */
found_data = 0;
- while (!url_feof(pb)) {
+ while (!avio_feof(pb)) {
/* stop at data chunk if seeking is not supported or
data chunk size is unknown */
tag = avio_rb32(pb);
size = avio_rb64(pb);
pos = avio_tell(pb);
- if (url_feof(pb))
+ if (avio_feof(pb))
break;
switch (tag) {
int res, pkt_size = 0, pkt_frames = 0;
int64_t left = CAF_MAX_PKT_SIZE;
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
/* don't read past end of data chunk */
int64_t pos;
int ret;
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
pos = avio_tell(pb);
static int daud_packet(AVFormatContext *s, AVPacket *pkt) {
AVIOContext *pb = s->pb;
int ret, size;
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR(EIO);
size = avio_rb16(pb);
avio_rb16(pb); // unknown
hdr->video_frame_size = avio_rl32(pb);
hdr->audio_frame_size = avio_rl32(pb);
- if (url_feof(pb) || pb->error)
+ if (avio_feof(pb) || pb->error)
return AVERROR(EIO);
if (avio_rl32(pb) != 0xAA55AA55)
st->codec->codec_id = AV_CODEC_ID_DTS;
st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
- while (!url_feof(pb)) {
+ while (!avio_feof(pb)) {
chunk_type = avio_rb64(pb);
chunk_size = avio_rb64(pb);
state = avio_rb32(s->pb);
while ((state & 0xffffff7f) != 0x1f07003f) {
- if (url_feof(s->pb)) {
+ if (avio_feof(s->pb)) {
av_log(s, AV_LOG_ERROR, "Cannot find DV header.\n");
return -1;
}
if (ast->codec->sample_rate > 0)
avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
// find 'data' chunk
- while(avio_tell(pb) < c->vidpos && !url_feof(pb)){
+ while(avio_tell(pb) < c->vidpos && !avio_feof(pb)){
tag = avio_rl32(pb);
fsize = avio_rl32(pb);
if(tag == MKTAG('d', 'a', 't', 'a')) break;
return 0;
}
avio_seek(s->pb, c->vidpos, SEEK_SET);
- while(!url_feof(s->pb) && c->frames){
+ while(!avio_feof(s->pb) && c->frames){
if ((ret = avio_read(s->pb, buf, 4)) != 4) {
av_log(s, AV_LOG_ERROR, "failed reading chunk type\n");
return ret < 0 ? ret : AVERROR_INVALIDDATA;
ea->sample_rate = -1;
ea->num_channels = 1;
- while (!url_feof(pb) && in_header) {
+ while (!avio_feof(pb) && in_header) {
int in_subheader;
uint8_t byte;
byte = avio_r8(pb);
case 0xFD:
av_log(s, AV_LOG_DEBUG, "entered audio subheader\n");
in_subheader = 1;
- while (!url_feof(pb) && in_subheader) {
+ while (!avio_feof(pb) && in_subheader) {
uint8_t subbyte;
subbyte = avio_r8(pb);
{
av_log(s, AV_LOG_ERROR, "resyncing\n");
while (state != PACKET_ID) {
- if (url_feof(s->pb)) {
+ if (avio_feof(s->pb)) {
av_log(s, AV_LOG_ERROR, "cannot find FFM syncword\n");
return -1;
}
ffm->file_size = (UINT64_C(1) << 63) - 1;
}
- while(!url_feof(pb)) {
+ while(!avio_feof(pb)) {
unsigned id = avio_rb32(pb);
unsigned size = avio_rb32(pb);
int64_t next = avio_tell(pb) + size;
buf[i++] = c;
}
buf[i] = 0;
- } while (!url_feof(s) && (buf[0] == ';' || buf[0] == '#' || buf[0] == 0));
+ } while (!avio_feof(s) && (buf[0] == ';' || buf[0] == '#' || buf[0] == 0));
}
static AVChapter *read_chapter(AVFormatContext *s)
AVDictionary **m = &s->metadata;
uint8_t line[1024];
- while(!url_feof(s->pb)) {
+ while(!avio_feof(s->pb)) {
get_line(s->pb, line, sizeof(line));
if (!memcmp(line, ID_STREAM, strlen(ID_STREAM))) {
FilmstripDemuxContext *film = s->priv_data;
AVStream *st = s->streams[0];
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR(EIO);
pkt->dts = avio_tell(s->pb) / (st->codec->width * (st->codec->height + film->leading) * 4);
pkt->size = av_get_packet(s->pb, pkt, st->codec->width * st->codec->height * 4);
}
/* process metadata blocks */
- while (!url_feof(s->pb) && !metadata_last) {
+ while (!avio_feof(s->pb) && !metadata_last) {
avio_read(s->pb, header, 4);
flac_parse_block_header(header, &metadata_last, &metadata_type,
&metadata_size);
dts = avio_rb24(s->pb);
dts |= avio_r8(s->pb) << 24;
av_dlog(s, "type:%d, size:%d, dts:%"PRId64" pos:%"PRId64"\n", type, size, dts, avio_tell(s->pb));
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR_EOF;
avio_skip(s->pb, 3); /* stream id, always 0 */
flags = 0;
int b = avio_r8(pb);
if (b != gif87a_sig[i] && b != gif89a_sig[i])
i = -(b != 'G');
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
}
return 0;
ret = AVERROR_EOF;
}
- while (GIF_TRAILER != (block_label = avio_r8(pb)) && !url_feof(pb)) {
+ while (GIF_TRAILER != (block_label = avio_r8(pb)) && !avio_feof(pb)) {
if (block_label == GIF_EXTENSION_INTRODUCER) {
if ((ret = gif_read_ext (s)) < 0 )
goto resync;
if ((ret >= 0 && !frame_parsed) || ret == AVERROR_EOF) {
/* This might happen when there is no image block
* between extension blocks and GIF_TRAILER or EOF */
- if (!gdc->ignore_loop && (block_label == GIF_TRAILER || url_feof(pb))
+ if (!gdc->ignore_loop && (block_label == GIF_TRAILER || avio_feof(pb))
&& (gdc->total_iter < 0 || ++gdc->iter_count < gdc->total_iter))
return avio_seek(pb, 0, SEEK_SET);
return AVERROR_EOF;
#define READ_ONE() \
{ \
- if (!max_interval-- || url_feof(pb)) \
+ if (!max_interval-- || avio_feof(pb)) \
goto out; \
tmp = tmp << 8 | avio_r8(pb); \
}
int field_nr, field_info, skip = 0;
int stream_index;
if (!parse_packet_header(pb, &pkt_type, &pkt_len)) {
- if (!url_feof(pb))
+ if (!avio_feof(pb))
av_log(s, AV_LOG_ERROR, "sync lost\n");
return -1;
}
pls->finished = 0;
pls->type = PLS_TYPE_UNSPECIFIED;
}
- while (!url_feof(in)) {
+ while (!avio_feof(in)) {
read_chomp_line(in, line, sizeof(line));
if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
is_variant = 1;
AVRational tb;
ret = av_read_frame(pls->ctx, &pls->pkt);
if (ret < 0) {
- if (!url_feof(&pls->pb) && ret != AVERROR_EOF)
+ if (!avio_feof(&pls->pb) && ret != AVERROR_EOF)
return ret;
reset_packet(&pls->pkt);
break;
free_segment_list(s);
s->finished = 0;
- while (!url_feof(in)) {
+ while (!avio_feof(in)) {
read_chomp_line(in, line, sizeof(line));
if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
struct variant_info info = {{0}};
unsigned char palette_buffer[768];
uint32_t palette[256];
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return s->pb->error ? s->pb->error : AVERROR_EOF;
if (idcin->next_chunk_is_video) {
while (!packet_read) {
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR(EIO);
/* get the next chunk preamble */
iff->maud_bits = -1;
iff->maud_compression = -1;
- while(!url_feof(pb)) {
+ while(!avio_feof(pb)) {
uint64_t orig_pos;
int res;
const char *metadata_tag = NULL;
infer_size(&codec->width, &codec->height, size[0]);
} else {
f[0] = s1->pb;
- if (url_feof(f[0]))
+ if (avio_feof(f[0]))
return AVERROR(EIO);
if (s->frame_size > 0) {
size[0] = s->frame_size;
return chunk_type;
/* read the next chunk, wherever the file happens to be pointing */
- if (url_feof(pb))
+ if (avio_feof(pb))
return CHUNK_EOF;
if (avio_read(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
CHUNK_PREAMBLE_SIZE)
while ((chunk_size > 0) && (chunk_type != CHUNK_BAD)) {
/* read the next chunk, wherever the file happens to be pointing */
- if (url_feof(pb)) {
+ if (avio_feof(pb)) {
chunk_type = CHUNK_EOF;
break;
}
while (memcmp(signature_buffer, signature, sizeof(signature))) {
memmove(signature_buffer, signature_buffer + 1, sizeof(signature_buffer) - 1);
signature_buffer[sizeof(signature_buffer) - 1] = avio_r8(pb);
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
}
/* initialize private context members */
av_bprint_init(&header, 1024+FF_INPUT_BUFFER_PADDING_SIZE, 4096);
- while (!url_feof(pb)) {
+ while (!avio_feof(pb)) {
int cmd_len;
const char *p = line;
int64_t pos = avio_tell(pb);
AVIOContext *pb = s->pb;
AVStream *ast = s->streams[0];
- while (!url_feof(s->pb) && jv->pts < ast->nb_index_entries) {
+ while (!avio_feof(s->pb) && jv->pts < ast->nb_index_entries) {
const AVIndexEntry *e = ast->index_entries + jv->pts;
const JVFrame *jvf = jv->frames + jv->pts;
int64_t pos = avio_tell(pb);
av_bprint_clear(buf);
- while(!url_feof(pb)) {
+ while(!avio_feof(pb)) {
int c = avio_r8(pb);
if(c != '\r') {
av_bprint_chars(buf, c, 1);
st->codec->codec_id = AV_CODEC_ID_TEXT;
av_bprint_init(&line, 0, AV_BPRINT_SIZE_UNLIMITED);
- while(!url_feof(s->pb)) {
+ while(!avio_feof(s->pb)) {
int64_t pos = read_line(&line, s->pb);
int64_t header_offset = find_header(line.str);
if(header_offset >= 0) {
avio_skip(s->pb, 1012);
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
id = avio_rl32(s->pb);
size = avio_rl32(s->pb);
next_offset = avio_tell(s->pb) + size;
int ret, is_video = 0;
pos = avio_tell(s->pb);
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
id = avio_rl32(s->pb);
size = avio_rl32(s->pb);
return ret < 0 ? ret : AVERROR_EOF;
while (memcmp(buf, LXF_IDENT, LXF_IDENT_LENGTH)) {
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR_EOF;
memmove(buf, &buf[1], LXF_IDENT_LENGTH-1);
id = avio_rb32(pb);
// try to find a toplevel element
- while (!url_feof(pb)) {
+ while (!avio_feof(pb)) {
if (id == MATROSKA_ID_INFO || id == MATROSKA_ID_TRACKS ||
id == MATROSKA_ID_CUES || id == MATROSKA_ID_TAGS ||
id == MATROSKA_ID_SEEKHEAD || id == MATROSKA_ID_ATTACHMENTS ||
* use it safely here to catch EOS. */
if (!(total = avio_r8(pb))) {
/* we might encounter EOS here */
- if (!url_feof(pb)) {
+ if (!avio_feof(pb)) {
int64_t pos = avio_tell(pb);
av_log(matroska->ctx, AV_LOG_ERROR,
"Read error at pos. %"PRIu64" (0x%"PRIx64")\n",
uint32_t chunk_size, payload_size;
int ret;
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
avio_skip(pb, 4);
if (!st)
return AVERROR(ENOMEM);
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
char *p;
AVPacket *sub;
int64_t pos = avio_tell(s->pb);
MlvContext *mlv = avctx->priv_data;
AVIOContext *pb = mlv->pb[file];
int ret;
- while (!url_feof(pb)) {
+ while (!avio_feof(pb)) {
int type;
unsigned int size;
type = avio_rl32(pb);
left = mmf->data_end - avio_tell(s->pb);
size = FFMIN(left, MAX_SIZE);
- if (url_feof(s->pb) || size <= 0)
+ if (avio_feof(s->pb) || size <= 0)
return AVERROR_EOF;
ret = av_get_packet(s->pb, pkt, size);
avio_skip(pb, 16);
for (type = 0; type != -1 && avio_tell(pb) < next; ) {
- if(url_feof(pb))
+ if(avio_feof(pb))
return AVERROR_EOF;
type = avio_rb16(pb);
len = avio_rb16(pb);
if (atom.size < 0)
atom.size = INT64_MAX;
- while (total_size + 8 <= atom.size && !url_feof(pb)) {
+ while (total_size + 8 <= atom.size && !avio_feof(pb)) {
int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL;
a.size = atom.size;
a.type=0;
avio_seek(s->pb, mov->next_root_atom, SEEK_SET);
mov->next_root_atom = 0;
if (mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
- url_feof(s->pb))
+ avio_feof(s->pb))
return AVERROR_EOF;
av_dlog(s, "read fragments, offset 0x%"PRIx64"\n", avio_tell(s->pb));
goto retry;
return AVERROR_INVALIDDATA;
}
- while(!url_feof(pb)){
+ while(!avio_feof(pb)){
pos = avio_tell(pb);
mpc8_get_chunk_header(pb, &tag, &size);
if(tag == TAG_STREAMHDR)
int tag;
int64_t pos, size;
- while(!url_feof(s->pb)){
+ while(!avio_feof(s->pb)){
pos = avio_tell(s->pb);
/* don't return bogus packets with the ape tag data */
state = *header_state;
n = *size_ptr;
while (n > 0) {
- if (url_feof(pb))
+ if (avio_feof(pb))
break;
v = avio_r8(pb);
n--;
startcode = find_next_start_code(s->pb, &size, &m->header_state);
last_sync = avio_tell(s->pb);
if (startcode < 0) {
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR_EOF;
// FIXME we should remember header_state
return AVERROR(EAGAIN);
}
av_bprint_init(&header, 0, AV_BPRINT_SIZE_UNLIMITED);
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
char line[MAX_LINE_SIZE];
int len = ff_get_line(s->pb, line, sizeof(line));
for (i = 0; i < MAX_RESYNC_SIZE; i++) {
c = avio_r8(pb);
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
if (c == 0x47) {
avio_seek(pb, -1, SEEK_CUR);
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codec->codec_id = AV_CODEC_ID_MPL2;
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
char line[4096];
char *p = line;
const int64_t pos = avio_tell(s->pb);
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
char line[1024];
float start, duration;
int fps, len = ff_get_line(s->pb, line, sizeof(line));
/* Some files start with "connected\r\n\r\n".
* So skip until we find the first byte of struct size */
- while(avio_r8(pb) != HEADER_SIZE && !url_feof(pb));
+ while(avio_r8(pb) != HEADER_SIZE && !avio_feof(pb));
- if(url_feof(pb)) {
+ if(avio_feof(pb)) {
av_log(ctx, AV_LOG_ERROR, "Could not find valid start.\n");
return -1;
}
static int mxf_read_sync(AVIOContext *pb, const uint8_t *key, unsigned size)
{
int i, b;
- for (i = 0; i < size && !url_feof(pb); i++) {
+ for (i = 0; i < size && !avio_feof(pb); i++) {
b = avio_r8(pb);
if (b == key[0])
i = 0;
if (!ctx)
return AVERROR(ENOMEM);
- while (avio_tell(pb) + 4 < klv_end && !url_feof(pb)) {
+ while (avio_tell(pb) + 4 < klv_end && !avio_feof(pb)) {
int ret;
int tag = avio_rb16(pb);
int size = avio_rb16(pb); /* KLV specified by 0x53 */
mxf_read_random_index_pack(s);
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
const MXFMetadataReadTableEntry *metadata;
if (avio_tell(s->pb) == last_pos) {
av_log(mxf->fc, AV_LOG_ERROR, "MXF structure loop detected\n");
skip:
avio_skip(s->pb, klv.length);
}
- return url_feof(s->pb) ? AVERROR_EOF : ret;
+ return avio_feof(s->pb) ? AVERROR_EOF : ret;
}
static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
uint8_t *startmarker_ptr, *end, *search_end, marker;
MXGContext *mxg = s->priv_data;
- while (!url_feof(s->pb) && !s->pb->error){
+ while (!avio_feof(s->pb) && !s->pb->error){
if (mxg->cache_size <= OVERREAD_SIZE) {
/* update internal buffer */
ret = mxg_update_cache(s, DEFAULT_PACKET_SIZE + OVERREAD_SIZE);
uint32_t state=-1;
while (state != NC_VIDEO_FLAG) {
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR(EIO);
state = (state<<8) + avio_r8(s->pb);
}
if (header_size <= 0)
return AVERROR_INVALIDDATA;
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
ff_get_line(s->pb, buffer, sizeof(buffer));
if (avio_tell(s->pb) >= header_size)
//nsv->state = NSV_UNSYNC;
for (i = 0; i < NSV_MAX_RESYNC; i++) {
- if (url_feof(pb)) {
+ if (avio_feof(pb)) {
av_dlog(s, "NSV EOF\n");
nsv->state = NSV_UNSYNC;
return -1;
table_entries_used = avio_rl32(pb);
av_dlog(s, "NSV NSVf info-strings size: %d, table entries: %d, bis %d\n",
strings_size, table_entries, table_entries_used);
- if (url_feof(pb))
+ if (avio_feof(pb))
return -1;
av_dlog(s, "NSV got header; filepos %"PRId64"\n", avio_tell(pb));
}
av_free(strings);
}
- if (url_feof(pb))
+ if (avio_feof(pb))
return -1;
av_dlog(s, "NSV got infos; filepos %"PRId64"\n", avio_tell(pb));
avio_seek(pb, nsv->base_offset + size, SEEK_SET); /* required for dumbdriving-271.nsv (2 extra bytes) */
- if (url_feof(pb))
+ if (avio_feof(pb))
return -1;
nsv->state = NSV_HAS_READ_NSVF;
return 0;
return 0; //-1; /* hey! eat what you've in your plate first! */
null_chunk_retry:
- if (url_feof(pb))
+ if (avio_feof(pb))
return -1;
for (i = 0; i < NSV_MAX_RESYNC_TRIES && nsv->state < NSV_FOUND_NSVS && !err; i++)
vsize -= auxsize + sizeof(uint16_t) + sizeof(uint32_t); /* that's becoming braindead */
}
- if (url_feof(pb))
+ if (avio_feof(pb))
return -1;
if (!vsize && !asize) {
nsv->state = NSV_UNSYNC;
/* Note, this may fail if the stream is not seekable, but that should
* not matter, as in this case we simply start where we currently are */
avio_seek(bc, pos, SEEK_SET);
- while (!url_feof(bc)) {
+ while (!avio_feof(bc)) {
state = (state << 8) | avio_r8(bc);
if ((state >> 56) != 'N')
continue;
pos -= 8;
} else {
frame_code = avio_r8(bc);
- if (url_feof(bc))
+ if (avio_feof(bc))
return AVERROR_EOF;
if (frame_code == 'N') {
tmp = frame_code;
if (!vst && !myth)
return 1; // no codec data needed
- while (!url_feof(pb)) {
+ while (!avio_feof(pb)) {
int size, subtype;
frametype = avio_r8(pb);
nuv_frametype frametype;
int ret, size;
- while (!url_feof(pb)) {
+ while (!avio_feof(pb)) {
int copyhdrsize = ctx->rtjpg_video ? HDRSIZE : 0;
uint64_t pos = avio_tell(pb);
static int nuv_resync(AVFormatContext *s, int64_t pos_limit) {
AVIOContext *pb = s->pb;
uint32_t tag = 0;
- while(!url_feof(pb) && avio_tell(pb) < pos_limit) {
+ while(!avio_feof(pb) && avio_tell(pb) < pos_limit) {
tag = (tag << 8) | avio_r8(pb);
if (tag == MKBETAG('R','T','j','j') &&
(tag = avio_rb32(pb)) == MKBETAG('j','j','j','j') &&
if (!nuv_resync(s, pos_limit))
return AV_NOPTS_VALUE;
- while (!url_feof(pb) && avio_tell(pb) < pos_limit) {
+ while (!avio_feof(pb) && avio_tell(pb) < pos_limit) {
if (avio_read(pb, hdr, HDRSIZE) < HDRSIZE)
return AV_NOPTS_VALUE;
frametype = hdr[0];
c = avio_r8(bc);
- if (url_feof(bc))
+ if (avio_feof(bc))
return AVERROR_EOF;
sync[sp++ & 3] = c;
if (p->current_frame >= p->nb_frames)
return AVERROR_EOF;
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
if (p->got_audio) {
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codec->codec_id = AV_CODEC_ID_PJS;
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
char line[4096];
char *p = line;
const int64_t pos = avio_tell(s->pb);
for (i = 0; i < index_cnt; i++) {
uint32_t size = avio_rl32(pb);
int flags = size & 1 ? AVINDEX_KEYFRAME : 0;
- if (url_feof(pb)) {
+ if (avio_feof(pb)) {
av_log(s, AV_LOG_FATAL, "Encountered EOF while reading index.\n");
return AVERROR_INVALIDDATA;
}
int ret = 0;
int i;
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
if (pmp->cur_stream == 0) {
int num_packets;
break;
}
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR(EIO);
}
}
QCPContext *c = s->priv_data;
unsigned int chunk_size, tag;
- while(!url_feof(pb)) {
+ while(!avio_feof(pb)) {
if (c->data_size) {
int pkt_size, ret, mode = avio_r8(pb);
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
AVPacket *sub;
const int64_t pos = avio_tell(s->pb) - (c != 0);
int n = ff_smil_extract_next_chunk(s->pb, &buf, &c);
uint32_t size = 8 * codec->channels;
int ret;
- if (url_feof(s->pb) || redspark->samples_count == s->streams[0]->duration)
+ if (avio_feof(s->pb) || redspark->samples_count == s->streams[0]->duration)
return AVERROR_EOF;
ret = av_get_packet(s->pb, pkt, size);
chunk_code = avio_rl32(pb);
chunk_size = avio_rl32(pb);
- if (url_feof(pb)) {
+ if (avio_feof(pb)) {
if (chunk_code || chunk_size) {
av_log(s, AV_LOG_WARNING, "INFO subchunk truncated\n");
return AVERROR_INVALIDDATA;
avio_skip(pb, tag_size - 8);
for(;;) {
- if (url_feof(pb))
+ if (avio_feof(pb))
return -1;
tag = avio_rl32(pb);
tag_size = avio_rb32(pb);
AVStream *st;
uint32_t state=0xFFFFFFFF;
- while(!url_feof(pb)){
+ while(!avio_feof(pb)){
int len, num, i;
*pos= avio_tell(pb) - 3;
if(rm->remaining_len > 0){
st = s->streams[i];
}
- if(len<0 || url_feof(s->pb))
+ if(len<0 || avio_feof(s->pb))
return AVERROR(EIO);
res = ff_rm_parse_packet (s, s->pb, st, st->priv_data, len, pkt,
break;
if (b == '\n') {
line[i] = '\0';
- return url_feof(pb) ? -1 : 0;
+ return avio_feof(pb) ? -1 : 0;
}
line[i] = b;
}
AVCodecContext *codec = s->streams[0]->codec;
int ret, size = 1024;
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR_EOF;
if (codec->codec_id == AV_CODEC_ID_ADPCM_IMA_RAD)
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
av_bprint_init(&hdr_buf, 0, AV_BPRINT_SIZE_UNLIMITED);
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
AVPacket *sub;
const int64_t pos = avio_tell(s->pb) - (c != 0);
int is_sync, n = ff_smil_extract_next_chunk(s->pb, &buf, &c);
int frame_size = 0;
int palchange = 0;
- if (url_feof(s->pb) || smk->cur_frame >= smk->frames)
+ if (avio_feof(s->pb) || smk->cur_frame >= smk->frames)
return AVERROR_EOF;
/* if we demuxed all streams, pass another frame */
duration = avio_rb32(pb); // in msec
- while (!url_feof(pb)) {
+ while (!avio_feof(pb)) {
htype = avio_rl32(pb);
switch (htype) {
case SMJPEG_TXT:
int64_t pos;
int ret;
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR_EOF;
pos = avio_tell(s->pb);
dtype = avio_rl32(s->pb);
while (!got_audio && ((read + 8) < size)) {
uint32_t sig, chunk_size;
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
sig = avio_rb32(pb);
while (!done) {
uint32_t sig, size;
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
sig = avio_rb32(pb);
{
int ret;
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR(EIO);
ret= av_get_packet(s->pb, pkt, MAX_SIZE);
if (ret < 0)
while (state != (AV_BSWAP16C(SYNCWORD1) << 16 | AV_BSWAP16C(SYNCWORD2))) {
state = (state << 8) | avio_r8(pb);
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
}
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
ff_subtitles_read_chunk(s->pb, &buf);
if (buf.len) {
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codec->codec_id = AV_CODEC_ID_SUBVIEWER1;
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
char line[4096];
int len = ff_get_line(s->pb, line, sizeof(line));
int hh, mm, ss;
av_bprint_init(&header, 0, AV_BPRINT_SIZE_UNLIMITED);
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
char line[2048];
int64_t pos = 0;
int len = ff_get_line(s->pb, line, sizeof(line));
{
int tag, len;
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
tag = avio_rl16(pb);
return 0;
}
- while (!url_feof(pb)) {
+ while (!avio_feof(pb)) {
enum TAKMetaDataType type;
int size;
int ret, pkt_size = tmv->stream_index ?
tmv->audio_chunk_size : tmv->video_chunk_size;
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
ret = av_get_packet(pb, pkt, pkt_size);
TtyDemuxContext *s = avctx->priv_data;
int n;
- if (url_feof(avctx->pb))
+ if (avio_feof(avctx->pb))
return AVERROR_EOF;
n = s->chars_per_frame;
chunk_size = avio_rl32(pb);
marker = avio_rl32(pb);
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR_EOF;
if (marker != TXD_MARKER && marker != TXD_MARKER2) {
av_log(s, AV_LOG_ERROR, "marker does not match\n");
int keyframe = 0;
uint32_t pts;
- if(url_feof(pb))
+ if(avio_feof(pb))
return AVERROR(EIO);
frame_size = avio_rl24(pb);
AVIOContext *pb = s->pb;
unsigned c, get_length = 0;
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
c = avio_r8(pb);
restart:
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
switch (vivo->type) {
while (vivo->sequence == old_sequence &&
(((vivo->type - 1) >> 1) == ((old_type - 1) >> 1))) {
- if (url_feof(pb)) {
+ if (avio_feof(pb)) {
ret = AVERROR_EOF;
break;
}
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codec->codec_id = AV_CODEC_ID_VPLAYER;
- while (!url_feof(s->pb)) {
+ while (!avio_feof(s->pb)) {
char line[4096];
char *p = line;
const int64_t pos = avio_tell(s->pb);
header_size -= len;
- } while (header_size >= 0 && !url_feof(s->pb));
+ } while (header_size >= 0 && !avio_feof(s->pb));
switch (rate_flag) {
case -1:
int64_t size;
for (;;) {
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR_EOF;
size = next_tag(pb, &tag);
if (tag == tag1)
size = next_tag(pb, &tag);
next_tag_ofs = avio_tell(pb) + size;
- if (url_feof(pb))
+ if (avio_feof(pb))
break;
switch (tag) {
uint8_t guid[16];
int64_t size;
- while (!url_feof(pb)) {
+ while (!avio_feof(pb)) {
avio_read(pb, guid, 16);
size = avio_rl64(pb);
if (size <= 24)
if (!st)
return AVERROR(ENOMEM);
- while (!url_feof(pb)) {
+ while (!avio_feof(pb)) {
if (avio_read(pb, guid, 16) != 16)
break;
size = avio_rl64(pb);
for (i = 0; i < count; i++) {
char chunk_key[5], *value;
- if (url_feof(pb) || (cur = avio_tell(pb)) < 0 || cur > end - 8 /* = tag + size */)
+ if (avio_feof(pb) || (cur = avio_tell(pb)) < 0 || cur > end - 8 /* = tag + size */)
break;
chunk_key[4] = 0;
fourcc_tag = avio_rl32(pb);
/* chunk sizes are 16-bit aligned */
size = (avio_rb32(pb) + 1) & (~1);
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR(EIO);
} while (fourcc_tag != BRCH_TAG);
fourcc_tag = avio_rl32(pb);
/* chunk sizes are 16-bit aligned */
size = (avio_rb32(pb) + 1) & (~1);
- if (url_feof(pb))
+ if (avio_feof(pb))
return AVERROR(EIO);
switch (fourcc_tag) {
if (wf->error || pb->error)
return -1;
- if (wf->position >= wf->length || url_feof(pb))
+ if (wf->position >= wf->length || avio_feof(pb))
return 0;
buf_size = FFMIN(buf_size, wf->length - wf->position);
{
ff_asf_guid guid;
int length, type;
- while(!url_feof(pb)) {
+ while(!avio_feof(pb)) {
char key[1024];
ff_get_guid(pb, &guid);
type = avio_rl32(pb);
{
WtvContext *wtv = s->priv_data;
AVIOContext *pb = wtv->pb;
- while (!url_feof(pb)) {
+ while (!avio_feof(pb)) {
ff_asf_guid g;
int len, sid, consumed;
while(1) {
uint64_t timestamp = avio_rl64(pb);
uint64_t frame_nb = avio_rl64(pb);
- if (url_feof(pb))
+ if (avio_feof(pb))
break;
ff_add_index_entry(&wtv->index_entries, &wtv->nb_index_entries, &wtv->index_entries_allocated_size,
0, timestamp, frame_nb, 0, AVINDEX_KEYFRAME);
while (1) {
uint64_t frame_nb = avio_rl64(pb);
uint64_t position = avio_rl64(pb);
- if (url_feof(pb))
+ if (avio_feof(pb))
break;
for (i = wtv->nb_index_entries - 1; i >= 0; i--) {
AVIndexEntry *e = wtv->index_entries + i;
int64_t pos;
uint32_t block_samples;
- if (url_feof(s->pb))
+ if (avio_feof(s->pb))
return AVERROR_EOF;
if (wc->block_parsed) {
if ((ret = wv_read_block_header(s, s->pb)) < 0)