Browse code

avio: deprecate url_feof

AVIOContext.eof_reached should be used directly instead.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>

Anton Khirnov authored on 2011/03/08 05:50:25
Showing 64 changed files
... ...
@@ -2568,7 +2568,7 @@ static int decode_thread(void *arg)
2568 2568
         }
2569 2569
         ret = av_read_frame(ic, pkt);
2570 2570
         if (ret < 0) {
2571
-            if (ret == AVERROR_EOF || url_feof(ic->pb))
2571
+            if (ret == AVERROR_EOF || ic->pb->eof_reached)
2572 2572
                 eof=1;
2573 2573
             if (url_ferror(ic->pb))
2574 2574
                 break;
... ...
@@ -259,7 +259,7 @@ static int fourxm_read_packet(AVFormatContext *s,
259 259
             return ret;
260 260
         fourcc_tag = AV_RL32(&header[0]);
261 261
         size = AV_RL32(&header[4]);
262
-        if (url_feof(pb))
262
+        if (pb->eof_reached)
263 263
             return AVERROR(EIO);
264 264
         switch (fourcc_tag) {
265 265
 
... ...
@@ -51,7 +51,7 @@ static int get_tag(AVIOContext *pb, uint32_t * tag)
51 51
 {
52 52
     int size;
53 53
 
54
-    if (url_feof(pb))
54
+    if (pb->eof_reached)
55 55
         return AVERROR(EIO);
56 56
 
57 57
     *tag = avio_rl32(pb);
... ...
@@ -122,7 +122,7 @@ static int amr_read_packet(AVFormatContext *s,
122 122
     AVCodecContext *enc = s->streams[0]->codec;
123 123
     int read, size = 0, toc, mode;
124 124
 
125
-    if (url_feof(s->pb))
125
+    if (s->pb->eof_reached)
126 126
     {
127 127
         return AVERROR(EIO);
128 128
     }
... ...
@@ -181,7 +181,7 @@ static int read_packet(AVFormatContext *s,
181 181
     Page *p;
182 182
     int tmp, record_size;
183 183
 
184
-    if (url_feof(s->pb))
184
+    if (s->pb->eof_reached)
185 185
         return AVERROR(EIO);
186 186
 
187 187
     if (anm->page < 0)
... ...
@@ -337,7 +337,7 @@ static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
337 337
     APEContext *ape = s->priv_data;
338 338
     uint32_t extra_size = 8;
339 339
 
340
-    if (url_feof(s->pb))
340
+    if (s->pb->eof_reached)
341 341
         return AVERROR(EIO);
342 342
     if (ape->currentframe > ape->totalframes)
343 343
         return AVERROR(EIO);
... ...
@@ -224,7 +224,7 @@ static int parse_playlist(AppleHTTPContext *c, const char *url,
224 224
     if (var)
225 225
         free_segment_list(var);
226 226
     c->finished = 0;
227
-    while (!url_feof(in)) {
227
+    while (!in->eof_reached) {
228 228
         read_chomp_line(in, line, sizeof(line));
229 229
         if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
230 230
             struct variant_info info = {{0}};
... ...
@@ -457,7 +457,7 @@ start:
457 457
         if (var->pb && !var->pkt.data) {
458 458
             ret = av_read_frame(var->ctx, &var->pkt);
459 459
             if (ret < 0) {
460
-                if (!url_feof(var->pb))
460
+                if (!var->pb->eof_reached)
461 461
                     return ret;
462 462
                 reset_packet(&var->pkt);
463 463
             }
... ...
@@ -174,7 +174,7 @@ static int parse_playlist(URLContext *h, const char *url)
174 174
 
175 175
     free_segment_list(s);
176 176
     s->finished = 0;
177
-    while (!url_feof(in)) {
177
+    while (!in->eof_reached) {
178 178
         read_chomp_line(in, line, sizeof(line));
179 179
         if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
180 180
             struct variant_info info = {{0}};
... ...
@@ -639,7 +639,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
639 639
             continue;
640 640
         } else if (!ff_guidcmp(&g, &ff_asf_marker_header)) {
641 641
             asf_read_marker(s, gsize);
642
-        } else if (url_feof(pb)) {
642
+        } else if (pb->eof_reached) {
643 643
             return -1;
644 644
         } else {
645 645
             if (!s->keylen) {
... ...
@@ -660,7 +660,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
660 660
     avio_rl64(pb);
661 661
     avio_r8(pb);
662 662
     avio_r8(pb);
663
-    if (url_feof(pb))
663
+    if (pb->eof_reached)
664 664
         return -1;
665 665
     asf->data_offset = avio_tell(pb);
666 666
     asf->packet_size_left = 0;
... ...
@@ -745,12 +745,12 @@ static int ff_asf_get_packet(AVFormatContext *s, AVIOContext *pb)
745 745
          */
746 746
         if (url_ferror(pb) == AVERROR(EAGAIN))
747 747
             return AVERROR(EAGAIN);
748
-        if (!url_feof(pb))
748
+        if (!pb->eof_reached)
749 749
             av_log(s, AV_LOG_ERROR, "ff asf bad header %x  at:%"PRId64"\n", c, avio_tell(pb));
750 750
     }
751 751
     if ((c & 0x8f) == 0x82) {
752 752
         if (d || e) {
753
-            if (!url_feof(pb))
753
+            if (!pb->eof_reached)
754 754
                 av_log(s, AV_LOG_ERROR, "ff asf bad non zero\n");
755 755
             return -1;
756 756
         }
... ...
@@ -886,7 +886,7 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
886 886
     ASFStream *asf_st = 0;
887 887
     for (;;) {
888 888
         int ret;
889
-        if(url_feof(pb))
889
+        if(pb->eof_reached)
890 890
             return AVERROR_EOF;
891 891
         if (asf->packet_size_left < FRAME_HEADER_SIZE
892 892
             || asf->packet_segments < 1) {
... ...
@@ -1195,7 +1195,7 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
1195 1195
        skip them until the simple index object is reached */
1196 1196
     while (ff_guidcmp(&g, &index_guid)) {
1197 1197
         int64_t gsize= avio_rl64(s->pb);
1198
-        if (gsize < 24 || url_feof(s->pb)) {
1198
+        if (gsize < 24 || s->pb->eof_reached) {
1199 1199
             avio_seek(s->pb, current_pos, SEEK_SET);
1200 1200
             return;
1201 1201
         }
... ...
@@ -92,7 +92,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
92 92
     header_remaining= INT_MAX;
93 93
     dst[0] = &st->codec->extradata;
94 94
     dst[1] = &ass->event_buffer;
95
-    while(!url_feof(pb)){
95
+    while(!pb->eof_reached){
96 96
         uint8_t line[MAX_LINESIZE];
97 97
 
98 98
         len = ff_get_line(pb, line, sizeof(line));
... ...
@@ -178,7 +178,7 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
178 178
 #ifdef DEBUG_SEEK
179 179
             av_log(s, AV_LOG_ERROR, "pos:%"PRId64", len:%X\n", pos, len);
180 180
 #endif
181
-            if(url_feof(pb))
181
+            if(pb->eof_reached)
182 182
                 return -1;
183 183
 
184 184
             if(last_pos == pos || pos == base - 8)
... ...
@@ -195,7 +195,7 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
195 195
             avio_rl32(pb);       /* size */
196 196
             duration = avio_rl32(pb);
197 197
 
198
-            if(url_feof(pb))
198
+            if(pb->eof_reached)
199 199
                 return -1;
200 200
 
201 201
             pos = avio_tell(pb);
... ...
@@ -360,7 +360,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
360 360
     codec_type = -1;
361 361
     frame_period = 0;
362 362
     for(;;) {
363
-        if (url_feof(pb))
363
+        if (pb->eof_reached)
364 364
             goto fail;
365 365
         tag = avio_rl32(pb);
366 366
         size = avio_rl32(pb);
... ...
@@ -989,7 +989,7 @@ resync:
989 989
     }
990 990
 
991 991
     memset(d, -1, sizeof(int)*8);
992
-    for(i=sync=avio_tell(pb); !url_feof(pb); i++) {
992
+    for(i=sync=avio_tell(pb); !pb->eof_reached; i++) {
993 993
         int j;
994 994
 
995 995
         for(j=0; j<7; j++)
... ...
@@ -1145,7 +1145,7 @@ static int avi_read_idx1(AVFormatContext *s, int size)
1145 1145
 #if defined(DEBUG_SEEK)
1146 1146
         av_log(s, AV_LOG_DEBUG, "%d cum_len=%"PRId64"\n", len, ast->cum_len);
1147 1147
 #endif
1148
-        if(url_feof(pb))
1148
+        if(pb->eof_reached)
1149 1149
             return -1;
1150 1150
 
1151 1151
         if(last_pos == pos)
... ...
@@ -1203,7 +1203,7 @@ static int avi_load_index(AVFormatContext *s)
1203 1203
     printf("movi_end=0x%"PRIx64"\n", avi->movi_end);
1204 1204
 #endif
1205 1205
     for(;;) {
1206
-        if (url_feof(pb))
1206
+        if (pb->eof_reached)
1207 1207
             break;
1208 1208
         tag = avio_rl32(pb);
1209 1209
         size = avio_rl32(pb);
... ...
@@ -432,6 +432,11 @@ attribute_deprecated int url_fgetc(AVIOContext *s);
432 432
 /**
433 433
  * @}
434 434
  */
435
+
436
+/**
437
+ * @deprecated use AVIOContext.eof_reached
438
+ */
439
+attribute_deprecated int url_feof(AVIOContext *s);
435 440
 #endif
436 441
 
437 442
 AVIOContext *avio_alloc_context(
... ...
@@ -494,12 +499,6 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
494 494
  */
495 495
 int64_t avio_size(AVIOContext *s);
496 496
 
497
-/**
498
- * feof() equivalent for AVIOContext.
499
- * @return non zero if and only if end of file
500
- */
501
-int url_feof(AVIOContext *s);
502
-
503 497
 int url_ferror(AVIOContext *s);
504 498
 
505 499
 int av_url_read_fpause(AVIOContext *h, int pause);
... ...
@@ -265,12 +265,14 @@ int64_t avio_size(AVIOContext *s)
265 265
     return size;
266 266
 }
267 267
 
268
+#if FF_API_OLD_AVIO
268 269
 int url_feof(AVIOContext *s)
269 270
 {
270 271
     if(!s)
271 272
         return 0;
272 273
     return s->eof_reached;
273 274
 }
275
+#endif
274 276
 
275 277
 int url_ferror(AVIOContext *s)
276 278
 {
... ...
@@ -598,7 +600,7 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size)
598 598
     }
599 599
     if (size1 == size) {
600 600
         if (url_ferror(s)) return url_ferror(s);
601
-        if (url_feof(s))   return AVERROR_EOF;
601
+        if (s->eof_reached)   return AVERROR_EOF;
602 602
     }
603 603
     return size1 - size;
604 604
 }
... ...
@@ -621,7 +623,7 @@ int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size)
621 621
     s->buf_ptr += len;
622 622
     if (!len) {
623 623
         if (url_ferror(s)) return url_ferror(s);
624
-        if (url_feof(s))   return AVERROR_EOF;
624
+        if (s->eof_reached)   return AVERROR_EOF;
625 625
     }
626 626
     return len;
627 627
 }
... ...
@@ -928,11 +930,11 @@ char *url_fgets(AVIOContext *s, char *buf, int buf_size)
928 928
     char *q;
929 929
 
930 930
     c = avio_r8(s);
931
-    if (url_feof(s))
931
+    if (s->eof_reached)
932 932
         return NULL;
933 933
     q = buf;
934 934
     for(;;) {
935
-        if (url_feof(s) || c == '\n')
935
+        if (s->eof_reached || c == '\n')
936 936
             break;
937 937
         if ((q - buf) < buf_size - 1)
938 938
             *q++ = c;
... ...
@@ -179,7 +179,7 @@ static int vid_read_packet(AVFormatContext *s,
179 179
     int audio_length;
180 180
     int ret_value;
181 181
 
182
-    if(vid->is_finished || url_feof(pb))
182
+    if(vid->is_finished || pb->eof_reached)
183 183
         return AVERROR(EIO);
184 184
 
185 185
     block_type = avio_r8(pb);
... ...
@@ -109,7 +109,7 @@ static int bfi_read_packet(AVFormatContext * s, AVPacket * pkt)
109 109
     BFIContext *bfi = s->priv_data;
110 110
     AVIOContext *pb = s->pb;
111 111
     int ret, audio_offset, video_offset, chunk_size, audio_size = 0;
112
-    if (bfi->nframes == 0 || url_feof(pb)) {
112
+    if (bfi->nframes == 0 || pb->eof_reached) {
113 113
         return AVERROR(EIO);
114 114
     }
115 115
 
... ...
@@ -117,7 +117,7 @@ static int bfi_read_packet(AVFormatContext * s, AVPacket * pkt)
117 117
     if (!bfi->avflag) {
118 118
         uint32_t state = 0;
119 119
         while(state != MKTAG('S','A','V','I')){
120
-            if (url_feof(pb))
120
+            if (pb->eof_reached)
121 121
                 return AVERROR(EIO);
122 122
             state = 256*state + avio_r8(pb);
123 123
         }
... ...
@@ -219,7 +219,7 @@ static int read_header(AVFormatContext *s,
219 219
 
220 220
     /* parse each chunk */
221 221
     found_data = 0;
222
-    while (!url_feof(pb)) {
222
+    while (!pb->eof_reached) {
223 223
 
224 224
         /* stop at data chunk if seeking is not supported or
225 225
            data chunk size is unknown */
... ...
@@ -228,7 +228,7 @@ static int read_header(AVFormatContext *s,
228 228
 
229 229
         tag  = avio_rb32(pb);
230 230
         size = avio_rb64(pb);
231
-        if (url_feof(pb))
231
+        if (pb->eof_reached)
232 232
             break;
233 233
 
234 234
         switch (tag) {
... ...
@@ -307,7 +307,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
307 307
     int res, pkt_size = 0, pkt_frames = 0;
308 308
     int64_t left      = CAF_MAX_PKT_SIZE;
309 309
 
310
-    if (url_feof(pb))
310
+    if (pb->eof_reached)
311 311
         return AVERROR(EIO);
312 312
 
313 313
     /* don't read past end of data chunk */
... ...
@@ -38,7 +38,7 @@ static int daud_header(AVFormatContext *s, AVFormatParameters *ap) {
38 38
 static int daud_packet(AVFormatContext *s, AVPacket *pkt) {
39 39
     AVIOContext *pb = s->pb;
40 40
     int ret, size;
41
-    if (url_feof(pb))
41
+    if (pb->eof_reached)
42 42
         return AVERROR(EIO);
43 43
     size = avio_rb16(pb);
44 44
     avio_rb16(pb); // unknown
... ...
@@ -147,7 +147,7 @@ static int cin_read_frame_header(CinDemuxContext *cin, AVIOContext *pb) {
147 147
     hdr->video_frame_size = avio_rl32(pb);
148 148
     hdr->audio_frame_size = avio_rl32(pb);
149 149
 
150
-    if (url_feof(pb) || url_ferror(pb))
150
+    if (pb->eof_reached || url_ferror(pb))
151 151
         return AVERROR(EIO);
152 152
 
153 153
     if (avio_rl32(pb) != 0xAA55AA55)
... ...
@@ -412,7 +412,7 @@ static int dv_read_header(AVFormatContext *s,
412 412
 
413 413
     state = avio_rb32(s->pb);
414 414
     while ((state & 0xffffff7f) != 0x1f07003f) {
415
-        if (url_feof(s->pb)) {
415
+        if (s->pb->eof_reached) {
416 416
             av_log(s, AV_LOG_ERROR, "Cannot find DV header.\n");
417 417
             return -1;
418 418
         }
... ...
@@ -104,7 +104,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
104 104
             return -1;
105 105
         ff_get_wav_header(pb, ast->codec, fsize);
106 106
         // find 'data' chunk
107
-        while(avio_tell(pb) < c->vidpos && !url_feof(pb)){
107
+        while(avio_tell(pb) < c->vidpos && !pb->eof_reached){
108 108
             tag = avio_rl32(pb);
109 109
             fsize = avio_rl32(pb);
110 110
             if(tag == MKTAG('d', 'a', 't', 'a')) break;
... ...
@@ -162,7 +162,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt)
162 162
         return 0;
163 163
     }
164 164
     avio_seek(s->pb, c->vidpos, SEEK_SET);
165
-    while(!url_feof(s->pb) && c->frames){
165
+    while(!s->pb->eof_reached && c->frames){
166 166
         avio_read(s->pb, buf, 4);
167 167
         switch(AV_RL32(buf)){
168 168
         case MKTAG('N', 'U', 'L', 'L'):
... ...
@@ -109,7 +109,7 @@ static int process_audio_header_elements(AVFormatContext *s)
109 109
     ea->sample_rate = -1;
110 110
     ea->num_channels = 1;
111 111
 
112
-    while (!url_feof(pb) && inHeader) {
112
+    while (!pb->eof_reached && inHeader) {
113 113
         int inSubheader;
114 114
         uint8_t byte;
115 115
         byte = avio_r8(pb);
... ...
@@ -118,7 +118,7 @@ static int process_audio_header_elements(AVFormatContext *s)
118 118
         case 0xFD:
119 119
             av_log (s, AV_LOG_DEBUG, "entered audio subheader\n");
120 120
             inSubheader = 1;
121
-            while (!url_feof(pb) && inSubheader) {
121
+            while (!pb->eof_reached && inSubheader) {
122 122
                 uint8_t subbyte;
123 123
                 subbyte = avio_r8(pb);
124 124
 
... ...
@@ -91,7 +91,7 @@ static int ffm_resync(AVFormatContext *s, int state)
91 91
 {
92 92
     av_log(s, AV_LOG_ERROR, "resyncing\n");
93 93
     while (state != PACKET_ID) {
94
-        if (url_feof(s->pb)) {
94
+        if (s->pb->eof_reached) {
95 95
             av_log(s, AV_LOG_ERROR, "cannot find FFM syncword\n");
96 96
             return -1;
97 97
         }
... ...
@@ -48,7 +48,7 @@ static void get_line(AVIOContext *s, uint8_t *buf, int size)
48 48
                 buf[i++] = c;
49 49
         }
50 50
         buf[i] = 0;
51
-    } while (!url_feof(s) && (buf[0] == ';' || buf[0] == '#' || buf[0] == 0));
51
+    } while (!s->eof_reached && (buf[0] == ';' || buf[0] == '#' || buf[0] == 0));
52 52
 }
53 53
 
54 54
 static AVChapter *read_chapter(AVFormatContext *s)
... ...
@@ -126,7 +126,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
126 126
     AVMetadata **m = &s->metadata;
127 127
     uint8_t line[1024];
128 128
 
129
-    while(!url_feof(s->pb)) {
129
+    while(!s->pb->eof_reached) {
130 130
         get_line(s->pb, line, sizeof(line));
131 131
 
132 132
         if (!memcmp(line, ID_STREAM, strlen(ID_STREAM))) {
... ...
@@ -80,7 +80,7 @@ static int read_packet(AVFormatContext *s,
80 80
     FilmstripDemuxContext *film = s->priv_data;
81 81
     AVStream *st = s->streams[0];
82 82
 
83
-    if (url_feof(s->pb))
83
+    if (s->pb->eof_reached)
84 84
         return AVERROR(EIO);
85 85
     pkt->dts = avio_tell(s->pb) / (st->codec->width * (st->codec->height + film->leading) * 4);
86 86
     pkt->size = av_get_packet(s->pb, pkt, st->codec->width * st->codec->height * 4);
... ...
@@ -46,7 +46,7 @@ static int flac_read_header(AVFormatContext *s,
46 46
     }
47 47
 
48 48
     /* process metadata blocks */
49
-    while (!url_feof(s->pb) && !metadata_last) {
49
+    while (!s->pb->eof_reached && !metadata_last) {
50 50
         avio_read(s->pb, header, 4);
51 51
         ff_flac_parse_block_header(header, &metadata_last, &metadata_type,
52 52
                                    &metadata_size);
... ...
@@ -311,7 +311,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
311 311
     dts = avio_rb24(s->pb);
312 312
     dts |= avio_r8(s->pb) << 24;
313 313
 //    av_log(s, AV_LOG_DEBUG, "type:%d, size:%d, dts:%d\n", type, size, dts);
314
-    if (url_feof(s->pb))
314
+    if (s->pb->eof_reached)
315 315
         return AVERROR_EOF;
316 316
     avio_seek(s->pb, 3, SEEK_CUR); /* stream id, always 0 */
317 317
     flags = 0;
... ...
@@ -368,7 +368,7 @@ static int gxf_header(AVFormatContext *s, AVFormatParameters *ap) {
368 368
 
369 369
 #define READ_ONE() \
370 370
     { \
371
-        if (!max_interval-- || url_feof(pb)) \
371
+        if (!max_interval-- || pb->eof_reached) \
372 372
             goto out; \
373 373
         tmp = tmp << 8 | avio_r8(pb); \
374 374
     }
... ...
@@ -422,13 +422,13 @@ static int gxf_packet(AVFormatContext *s, AVPacket *pkt) {
422 422
     AVIOContext *pb = s->pb;
423 423
     GXFPktType pkt_type;
424 424
     int pkt_len;
425
-    while (!url_feof(pb)) {
425
+    while (!pb->eof_reached) {
426 426
         AVStream *st;
427 427
         int track_type, track_id, ret;
428 428
         int field_nr, field_info, skip = 0;
429 429
         int stream_index;
430 430
         if (!parse_packet_header(pb, &pkt_type, &pkt_len)) {
431
-            if (!url_feof(pb))
431
+            if (!pb->eof_reached)
432 432
                 av_log(s, AV_LOG_ERROR, "sync lost\n");
433 433
             return -1;
434 434
         }
... ...
@@ -227,7 +227,7 @@ static int idcin_read_packet(AVFormatContext *s,
227 227
     unsigned char r, g, b;
228 228
     unsigned char palette_buffer[768];
229 229
 
230
-    if (url_feof(s->pb))
230
+    if (s->pb->eof_reached)
231 231
         return AVERROR(EIO);
232 232
 
233 233
     if (idcin->next_chunk_is_video) {
... ...
@@ -111,7 +111,7 @@ static int roq_read_packet(AVFormatContext *s,
111 111
 
112 112
     while (!packet_read) {
113 113
 
114
-        if (url_feof(s->pb))
114
+        if (s->pb->eof_reached)
115 115
             return AVERROR(EIO);
116 116
 
117 117
         /* get the next chunk preamble */
... ...
@@ -138,7 +138,7 @@ static int iff_read_header(AVFormatContext *s,
138 138
     // codec_tag used by ByteRun1 decoder to distinguish progressive (PBM) and interlaced (ILBM) content
139 139
     st->codec->codec_tag = avio_rl32(pb);
140 140
 
141
-    while(!url_feof(pb)) {
141
+    while(!pb->eof_reached) {
142 142
         uint64_t orig_pos;
143 143
         int res;
144 144
         const char *metadata_tag = NULL;
... ...
@@ -287,7 +287,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt)
287 287
             infer_size(&codec->width, &codec->height, size[0]);
288 288
     } else {
289 289
         f[0] = s1->pb;
290
-        if (url_feof(f[0]))
290
+        if (f[0]->eof_reached)
291 291
             return AVERROR(EIO);
292 292
         size[0]= 4096;
293 293
     }
... ...
@@ -225,7 +225,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
225 225
         return chunk_type;
226 226
 
227 227
     /* read the next chunk, wherever the file happens to be pointing */
228
-    if (url_feof(pb))
228
+    if (pb->eof_reached)
229 229
         return CHUNK_EOF;
230 230
     if (avio_read(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
231 231
         CHUNK_PREAMBLE_SIZE)
... ...
@@ -271,7 +271,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
271 271
     while ((chunk_size > 0) && (chunk_type != CHUNK_BAD)) {
272 272
 
273 273
         /* read the next chunk, wherever the file happens to be pointing */
274
-        if (url_feof(pb)) {
274
+        if (pb->eof_reached) {
275 275
             chunk_type = CHUNK_EOF;
276 276
             break;
277 277
         }
... ...
@@ -532,7 +532,7 @@ static int ipmovie_read_header(AVFormatContext *s,
532 532
     while (memcmp(signature_buffer, signature, sizeof(signature))) {
533 533
         memmove(signature_buffer, signature_buffer + 1, sizeof(signature_buffer) - 1);
534 534
         signature_buffer[sizeof(signature_buffer) - 1] = avio_r8(pb);
535
-        if (url_feof(pb))
535
+        if (pb->eof_reached)
536 536
             return AVERROR_EOF;
537 537
     }
538 538
     /* initialize private context members */
... ...
@@ -90,7 +90,7 @@ static int sync(AVFormatContext *s, uint8_t *header)
90 90
         return ret < 0 ? ret : AVERROR_EOF;
91 91
 
92 92
     while (memcmp(buf, LXF_IDENT, LXF_IDENT_LENGTH)) {
93
-        if (url_feof(s->pb))
93
+        if (s->pb->eof_reached)
94 94
             return AVERROR_EOF;
95 95
 
96 96
         memmove(buf, &buf[1], LXF_IDENT_LENGTH-1);
... ...
@@ -548,7 +548,7 @@ static int ebml_read_num(MatroskaDemuxContext *matroska, AVIOContext *pb,
548 548
      * use it safely here to catch EOS. */
549 549
     if (!(total = avio_r8(pb))) {
550 550
         /* we might encounter EOS here */
551
-        if (!url_feof(pb)) {
551
+        if (!pb->eof_reached) {
552 552
             int64_t pos = avio_tell(pb);
553 553
             av_log(matroska->ctx, AV_LOG_ERROR,
554 554
                    "Read error at pos. %"PRIu64" (0x%"PRIx64")\n",
... ...
@@ -266,7 +266,7 @@ static int mmf_read_packet(AVFormatContext *s,
266 266
     AVStream *st;
267 267
     int ret, size;
268 268
 
269
-    if (url_feof(s->pb))
269
+    if (s->pb->eof_reached)
270 270
         return AVERROR(EIO);
271 271
     st = s->streams[0];
272 272
 
... ...
@@ -259,7 +259,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
259 259
 
260 260
     if (atom.size < 0)
261 261
         atom.size = INT64_MAX;
262
-    while (total_size + 8 < atom.size && !url_feof(pb)) {
262
+    while (total_size + 8 < atom.size && !pb->eof_reached) {
263 263
         int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL;
264 264
         a.size = atom.size;
265 265
         a.type=0;
... ...
@@ -2411,7 +2411,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
2411 2411
         mov->found_mdat = 0;
2412 2412
         if (!url_is_streamed(s->pb) ||
2413 2413
             mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
2414
-            url_feof(s->pb))
2414
+            s->pb->eof_reached)
2415 2415
             return AVERROR_EOF;
2416 2416
         av_dlog(s, "read fragments, offset 0x%llx\n", avio_tell(s->pb));
2417 2417
         goto retry;
... ...
@@ -200,7 +200,7 @@ static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap)
200 200
         return -1;
201 201
     }
202 202
 
203
-    while(!url_feof(pb)){
203
+    while(!pb->eof_reached){
204 204
         pos = avio_tell(pb);
205 205
         mpc8_get_chunk_header(pb, &tag, &size);
206 206
         if(tag == TAG_STREAMHDR)
... ...
@@ -247,7 +247,7 @@ static int mpc8_read_packet(AVFormatContext *s, AVPacket *pkt)
247 247
     int tag;
248 248
     int64_t pos, size;
249 249
 
250
-    while(!url_feof(s->pb)){
250
+    while(!s->pb->eof_reached){
251 251
         pos = avio_tell(s->pb);
252 252
         mpc8_get_chunk_header(s->pb, &tag, &size);
253 253
         if (size < 0)
... ...
@@ -143,7 +143,7 @@ static int find_next_start_code(AVIOContext *pb, int *size_ptr,
143 143
     state = *header_state;
144 144
     n = *size_ptr;
145 145
     while (n > 0) {
146
-        if (url_feof(pb))
146
+        if (pb->eof_reached)
147 147
             break;
148 148
         v = avio_r8(pb);
149 149
         n--;
... ...
@@ -253,7 +253,7 @@ static int mpegps_read_pes_header(AVFormatContext *s,
253 253
         last_sync = avio_tell(s->pb);
254 254
     //printf("startcode=%x pos=0x%"PRIx64"\n", startcode, avio_tell(s->pb));
255 255
     if (startcode < 0){
256
-        if(url_feof(s->pb))
256
+        if(s->pb->eof_reached)
257 257
             return AVERROR_EOF;
258 258
         //FIXME we should remember header_state
259 259
         return AVERROR(EAGAIN);
... ...
@@ -1329,7 +1329,7 @@ static int mpegts_resync(AVFormatContext *s)
1329 1329
 
1330 1330
     for(i = 0;i < MAX_RESYNC_SIZE; i++) {
1331 1331
         c = avio_r8(pb);
1332
-        if (url_feof(pb))
1332
+        if (pb->eof_reached)
1333 1333
             return -1;
1334 1334
         if (c == 0x47) {
1335 1335
             avio_seek(pb, -1, SEEK_CUR);
... ...
@@ -88,9 +88,9 @@ static int msnwc_tcp_read_header(AVFormatContext *ctx, AVFormatParameters *ap)
88 88
 
89 89
     /* Some files start with "connected\r\n\r\n".
90 90
      * So skip until we find the first byte of struct size */
91
-    while(avio_r8(pb) != HEADER_SIZE && !url_feof(pb));
91
+    while(avio_r8(pb) != HEADER_SIZE && !pb->eof_reached);
92 92
 
93
-    if(url_feof(pb)) {
93
+    if(pb->eof_reached) {
94 94
         av_log(ctx, AV_LOG_ERROR, "Could not find valid start.");
95 95
         return -1;
96 96
     }
... ...
@@ -179,7 +179,7 @@ static int64_t klv_decode_ber_length(AVIOContext *pb)
179 179
 static int mxf_read_sync(AVIOContext *pb, const uint8_t *key, unsigned size)
180 180
 {
181 181
     int i, b;
182
-    for (i = 0; i < size && !url_feof(pb); i++) {
182
+    for (i = 0; i < size && !pb->eof_reached; i++) {
183 183
         b = avio_r8(pb);
184 184
         if (b == key[0])
185 185
             i = 0;
... ...
@@ -305,7 +305,7 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
305 305
 {
306 306
     KLVPacket klv;
307 307
 
308
-    while (!url_feof(s->pb)) {
308
+    while (!s->pb->eof_reached) {
309 309
         if (klv_read_packet(&klv, s->pb) < 0)
310 310
             return -1;
311 311
         PRINT_KEY(s, "read packet", klv.key);
... ...
@@ -914,7 +914,7 @@ static int mxf_read_header(AVFormatContext *s, AVFormatParameters *ap)
914 914
     }
915 915
     avio_seek(s->pb, -14, SEEK_CUR);
916 916
     mxf->fc = s;
917
-    while (!url_feof(s->pb)) {
917
+    while (!s->pb->eof_reached) {
918 918
         const MXFMetadataReadTableEntry *metadata;
919 919
 
920 920
         if (klv_read_packet(&klv, s->pb) < 0)
... ...
@@ -132,7 +132,7 @@ static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt)
132 132
     uint8_t *startmarker_ptr, *end, *search_end, marker;
133 133
     MXGContext *mxg = s->priv_data;
134 134
 
135
-    while (!url_feof(s->pb) && !url_ferror(s->pb)){
135
+    while (!s->pb->eof_reached && !url_ferror(s->pb)){
136 136
         if (mxg->cache_size <= OVERREAD_SIZE) {
137 137
             /* update internal buffer */
138 138
             ret = mxg_update_cache(s, DEFAULT_PACKET_SIZE + OVERREAD_SIZE);
... ...
@@ -66,7 +66,7 @@ static int nc_read_packet(AVFormatContext *s, AVPacket *pkt)
66 66
 
67 67
     uint32_t state=-1;
68 68
     while (state != NC_VIDEO_FLAG) {
69
-        if (url_feof(s->pb))
69
+        if (s->pb->eof_reached)
70 70
             return AVERROR(EIO);
71 71
         state = (state<<8) + avio_r8(s->pb);
72 72
     }
... ...
@@ -230,7 +230,7 @@ static int nsv_resync(AVFormatContext *s)
230 230
     //nsv->state = NSV_UNSYNC;
231 231
 
232 232
     for (i = 0; i < NSV_MAX_RESYNC; i++) {
233
-        if (url_feof(pb)) {
233
+        if (pb->eof_reached) {
234 234
             av_dlog(s, "NSV EOF\n");
235 235
             nsv->state = NSV_UNSYNC;
236 236
             return -1;
... ...
@@ -296,7 +296,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap)
296 296
     table_entries_used = avio_rl32(pb);
297 297
     av_dlog(s, "NSV NSVf info-strings size: %d, table entries: %d, bis %d\n",
298 298
             strings_size, table_entries, table_entries_used);
299
-    if (url_feof(pb))
299
+    if (pb->eof_reached)
300 300
         return -1;
301 301
 
302 302
     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)
331 331
         }
332 332
         av_free(strings);
333 333
     }
334
-    if (url_feof(pb))
334
+    if (pb->eof_reached)
335 335
         return -1;
336 336
 
337 337
     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)
378 378
 
379 379
     avio_seek(pb, nsv->base_offset + size, SEEK_SET); /* required for dumbdriving-271.nsv (2 extra bytes) */
380 380
 
381
-    if (url_feof(pb))
381
+    if (pb->eof_reached)
382 382
         return -1;
383 383
     nsv->state = NSV_HAS_READ_NSVF;
384 384
     return 0;
... ...
@@ -554,7 +554,7 @@ static int nsv_read_chunk(AVFormatContext *s, int fill_header)
554 554
         return 0; //-1; /* hey! eat what you've in your plate first! */
555 555
 
556 556
 null_chunk_retry:
557
-    if (url_feof(pb))
557
+    if (pb->eof_reached)
558 558
         return -1;
559 559
 
560 560
     for (i = 0; i < NSV_MAX_RESYNC_TRIES && nsv->state < NSV_FOUND_NSVS && !err; i++)
... ...
@@ -588,7 +588,7 @@ null_chunk_retry:
588 588
         vsize -= auxsize + sizeof(uint16_t) + sizeof(uint32_t); /* that's becoming braindead */
589 589
     }
590 590
 
591
-    if (url_feof(pb))
591
+    if (pb->eof_reached)
592 592
         return -1;
593 593
     if (!vsize && !asize) {
594 594
         nsv->state = NSV_UNSYNC;
... ...
@@ -121,7 +121,7 @@ static uint64_t find_any_startcode(AVIOContext *bc, int64_t pos){
121 121
     if(pos >= 0)
122 122
         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
123 123
 
124
-    while(!url_feof(bc)){
124
+    while(!bc->eof_reached){
125 125
         state= (state<<8) | avio_r8(bc);
126 126
         if((state>>56) != 'N')
127 127
             continue;
... ...
@@ -790,7 +790,7 @@ static int nut_read_packet(AVFormatContext *s, AVPacket *pkt)
790 790
             pos-=8;
791 791
         }else{
792 792
             frame_code = avio_r8(bc);
793
-            if(url_feof(bc))
793
+            if(bc->eof_reached)
794 794
                 return -1;
795 795
             if(frame_code == 'N'){
796 796
                 tmp= frame_code;
... ...
@@ -60,7 +60,7 @@ static int get_codec_data(AVIOContext *pb, AVStream *vst,
60 60
     nuv_frametype frametype;
61 61
     if (!vst && !myth)
62 62
         return 1; // no codec data needed
63
-    while (!url_feof(pb)) {
63
+    while (!pb->eof_reached) {
64 64
         int size, subtype;
65 65
         frametype = avio_r8(pb);
66 66
         switch (frametype) {
... ...
@@ -195,7 +195,7 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) {
195 195
     uint8_t hdr[HDRSIZE];
196 196
     nuv_frametype frametype;
197 197
     int ret, size;
198
-    while (!url_feof(pb)) {
198
+    while (!pb->eof_reached) {
199 199
         int copyhdrsize = ctx->rtjpg_video ? HDRSIZE : 0;
200 200
         uint64_t pos = avio_tell(pb);
201 201
         ret = avio_read(pb, hdr, HDRSIZE);
... ...
@@ -219,7 +219,7 @@ ogg_read_page (AVFormatContext * s, int *str)
219 219
             break;
220 220
 
221 221
         c = avio_r8(bc);
222
-        if (url_feof(bc))
222
+        if (bc->eof_reached)
223 223
             return -1;
224 224
         sync[sp++ & 3] = c;
225 225
     }while (i++ < MAX_PAGE_SIZE);
... ...
@@ -241,7 +241,7 @@ static int str_read_packet(AVFormatContext *s,
241 241
             break;
242 242
         }
243 243
 
244
-        if (url_feof(pb))
244
+        if (pb->eof_reached)
245 245
             return AVERROR(EIO);
246 246
     }
247 247
 }
... ...
@@ -140,7 +140,7 @@ static int qcp_read_packet(AVFormatContext *s, AVPacket *pkt)
140 140
     QCPContext    *c  = s->priv_data;
141 141
     unsigned int  chunk_size, tag;
142 142
 
143
-    while(!url_feof(pb)) {
143
+    while(!pb->eof_reached) {
144 144
         if (c->data_size) {
145 145
             int pkt_size, ret, mode = avio_r8(pb);
146 146
 
... ...
@@ -409,7 +409,7 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap)
409 409
     avio_rb32(pb); /* number of headers */
410 410
 
411 411
     for(;;) {
412
-        if (url_feof(pb))
412
+        if (pb->eof_reached)
413 413
             return -1;
414 414
         tag = avio_rl32(pb);
415 415
         tag_size = avio_rb32(pb);
... ...
@@ -515,7 +515,7 @@ static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_
515 515
     AVStream *st;
516 516
     uint32_t state=0xFFFFFFFF;
517 517
 
518
-    while(!url_feof(pb)){
518
+    while(!pb->eof_reached){
519 519
         int len, num, i;
520 520
         *pos= avio_tell(pb) - 3;
521 521
         if(rm->remaining_len > 0){
... ...
@@ -848,7 +848,7 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
848 848
                     st = s->streams[i];
849 849
             }
850 850
 
851
-            if(len<0 || url_feof(s->pb))
851
+            if(len<0 || s->pb->eof_reached)
852 852
                 return AVERROR(EIO);
853 853
 
854 854
             res = ff_rm_parse_packet (s, s->pb, st, st->priv_data, len, pkt,
... ...
@@ -235,7 +235,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
235 235
     int palchange = 0;
236 236
     int pos;
237 237
 
238
-    if (url_feof(s->pb) || smk->cur_frame >= smk->frames)
238
+    if (s->pb->eof_reached || smk->cur_frame >= smk->frames)
239 239
         return AVERROR_EOF;
240 240
 
241 241
     /* if we demuxed all streams, pass another frame */
... ...
@@ -130,7 +130,7 @@ static int sol_read_packet(AVFormatContext *s,
130 130
 {
131 131
     int ret;
132 132
 
133
-    if (url_feof(s->pb))
133
+    if (s->pb->eof_reached)
134 134
         return AVERROR(EIO);
135 135
     ret= av_get_packet(s->pb, pkt, MAX_SIZE);
136 136
     pkt->stream_index = 0;
... ...
@@ -127,7 +127,7 @@ static int sox_read_packet(AVFormatContext *s,
127 127
 {
128 128
     int ret, size;
129 129
 
130
-    if (url_feof(s->pb))
130
+    if (s->pb->eof_reached)
131 131
         return AVERROR_EOF;
132 132
 
133 133
     size = SOX_SAMPLES*s->streams[0]->codec->block_align;
... ...
@@ -171,7 +171,7 @@ static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
171 171
 
172 172
     while (state != (AV_BSWAP16C(SYNCWORD1) << 16 | AV_BSWAP16C(SYNCWORD2))) {
173 173
         state = (state << 8) | avio_r8(pb);
174
-        if (url_feof(pb))
174
+        if (pb->eof_reached)
175 175
             return AVERROR_EOF;
176 176
     }
177 177
 
... ...
@@ -81,7 +81,7 @@ static int srt_read_packet(AVFormatContext *s, AVPacket *pkt)
81 81
     do {
82 82
         ptr2 = ptr;
83 83
         ptr += ff_get_line(s->pb, ptr, sizeof(buffer)+buffer-ptr);
84
-    } while (!is_eol(*ptr2) && !url_feof(s->pb) && ptr-buffer<sizeof(buffer)-1);
84
+    } while (!is_eol(*ptr2) && !s->pb->eof_reached && ptr-buffer<sizeof(buffer)-1);
85 85
 
86 86
     if (buffer[0] && !(res = av_new_packet(pkt, ptr-buffer))) {
87 87
         memcpy(pkt->data, buffer, pkt->size);
... ...
@@ -27,7 +27,7 @@ static int get_swf_tag(AVIOContext *pb, int *len_ptr)
27 27
 {
28 28
     int tag, len;
29 29
 
30
-    if (url_feof(pb))
30
+    if (pb->eof_reached)
31 31
         return -1;
32 32
 
33 33
     tag = avio_rl16(pb);
... ...
@@ -146,7 +146,7 @@ static int tmv_read_packet(AVFormatContext *s, AVPacket *pkt)
146 146
     int ret, pkt_size = tmv->stream_index ?
147 147
                         tmv->audio_chunk_size : tmv->video_chunk_size;
148 148
 
149
-    if (url_feof(pb))
149
+    if (pb->eof_reached)
150 150
         return AVERROR_EOF;
151 151
 
152 152
     ret = av_get_packet(pb, pkt, pkt_size);
... ...
@@ -106,7 +106,7 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
106 106
     TtyDemuxContext *s = avctx->priv_data;
107 107
     int n;
108 108
 
109
-    if (url_feof(avctx->pb))
109
+    if (avctx->pb->eof_reached)
110 110
         return AVERROR_EOF;
111 111
 
112 112
     n = s->chars_per_frame;
... ...
@@ -61,7 +61,7 @@ next_chunk:
61 61
     chunk_size = avio_rl32(pb);
62 62
     marker     = avio_rl32(pb);
63 63
 
64
-    if (url_feof(s->pb))
64
+    if (s->pb->eof_reached)
65 65
         return AVERROR_EOF;
66 66
     if (marker != TXD_MARKER && marker != TXD_MARKER2) {
67 67
         av_log(s, AV_LOG_ERROR, "marker does not match\n");
... ...
@@ -92,7 +92,7 @@ static int vc1t_read_packet(AVFormatContext *s,
92 92
     int keyframe = 0;
93 93
     uint32_t pts;
94 94
 
95
-    if(url_feof(pb))
95
+    if(pb->eof_reached)
96 96
         return AVERROR(EIO);
97 97
 
98 98
     frame_size = avio_rl24(pb);
... ...
@@ -155,7 +155,7 @@ static int64_t find_tag(AVIOContext *pb, uint32_t tag1)
155 155
     int64_t size;
156 156
 
157 157
     for (;;) {
158
-        if (url_feof(pb))
158
+        if (pb->eof_reached)
159 159
             return -1;
160 160
         size = next_tag(pb, &tag);
161 161
         if (tag == tag1)
... ...
@@ -234,7 +234,7 @@ static int wav_read_header(AVFormatContext *s,
234 234
     av_set_pts_info(st, 64, 1, st->codec->sample_rate);
235 235
 
236 236
     for (;;) {
237
-        if (url_feof(pb))
237
+        if (pb->eof_reached)
238 238
             return -1;
239 239
         size = next_tag(pb, &tag);
240 240
         if (tag == MKTAG('d', 'a', 't', 'a')){
... ...
@@ -269,7 +269,7 @@ static int64_t find_guid(AVIOContext *pb, const uint8_t guid1[16])
269 269
     uint8_t guid[16];
270 270
     int64_t size;
271 271
 
272
-    while (!url_feof(pb)) {
272
+    while (!pb->eof_reached) {
273 273
         avio_read(pb, guid, 16);
274 274
         size = avio_rl64(pb);
275 275
         if (size <= 24)
... ...
@@ -157,7 +157,7 @@ static int wc3_read_header(AVFormatContext *s,
157 157
         fourcc_tag = avio_rl32(pb);
158 158
         /* chunk sizes are 16-bit aligned */
159 159
         size = (avio_rb32(pb) + 1) & (~1);
160
-        if (url_feof(pb))
160
+        if (pb->eof_reached)
161 161
             return AVERROR(EIO);
162 162
 
163 163
     } while (fourcc_tag != BRCH_TAG);
... ...
@@ -208,7 +208,7 @@ static int wc3_read_packet(AVFormatContext *s,
208 208
         fourcc_tag = avio_rl32(pb);
209 209
         /* chunk sizes are 16-bit aligned */
210 210
         size = (avio_rb32(pb) + 1) & (~1);
211
-        if (url_feof(pb))
211
+        if (pb->eof_reached)
212 212
             return AVERROR(EIO);
213 213
 
214 214
         switch (fourcc_tag) {
... ...
@@ -79,7 +79,7 @@ static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size)
79 79
 
80 80
     if (wf->error || url_ferror(pb))
81 81
         return -1;
82
-    if (wf->position >= wf->length || url_feof(pb))
82
+    if (wf->position >= wf->length || pb->eof_reached)
83 83
         return 0;
84 84
 
85 85
     buf_size = FFMIN(buf_size, wf->length - wf->position);
... ...
@@ -554,7 +554,7 @@ static void parse_legacy_attrib(AVFormatContext *s, AVIOContext *pb)
554 554
 {
555 555
     ff_asf_guid guid;
556 556
     int length, type;
557
-    while(!url_feof(pb)) {
557
+    while(!pb->eof_reached) {
558 558
         char key[1024];
559 559
         ff_get_guid(pb, &guid);
560 560
         type   = avio_rl32(pb);
... ...
@@ -770,7 +770,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
770 770
 {
771 771
     WtvContext *wtv = s->priv_data;
772 772
     AVIOContext *pb = wtv->pb;
773
-    while (!url_feof(pb)) {
773
+    while (!pb->eof_reached) {
774 774
         ff_asf_guid g;
775 775
         int len, sid, consumed;
776 776
 
... ...
@@ -997,7 +997,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
997 997
             while(1) {
998 998
                 uint64_t timestamp = avio_rl64(pb);
999 999
                 uint64_t frame_nb  = avio_rl64(pb);
1000
-                if (url_feof(pb))
1000
+                if (pb->eof_reached)
1001 1001
                     break;
1002 1002
                 ff_add_index_entry(&wtv->index_entries, &wtv->nb_index_entries, &wtv->index_entries_allocated_size,
1003 1003
                                    0, timestamp, frame_nb, 0, AVINDEX_KEYFRAME);
... ...
@@ -1011,7 +1011,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
1011 1011
                     while (1) {
1012 1012
                         uint64_t frame_nb = avio_rl64(pb);
1013 1013
                         uint64_t position = avio_rl64(pb);
1014
-                        if (url_feof(pb))
1014
+                        if (pb->eof_reached)
1015 1015
                             break;
1016 1016
                         for (i = wtv->nb_index_entries - 1; i >= 0; i--) {
1017 1017
                             AVIndexEntry *e = wtv->index_entries + i;
... ...
@@ -241,7 +241,7 @@ static int wv_read_packet(AVFormatContext *s,
241 241
     int ret;
242 242
     int size, ver, off;
243 243
 
244
-    if (url_feof(s->pb))
244
+    if (s->pb->eof_reached)
245 245
         return AVERROR(EIO);
246 246
     if(wc->block_parsed){
247 247
         if(wv_read_block_header(s, s->pb, 0) < 0)