AVIOContext.error should be used directly instead.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
... | ... |
@@ -2570,7 +2570,7 @@ static int decode_thread(void *arg) |
2570 | 2570 |
if (ret < 0) { |
2571 | 2571 |
if (ret == AVERROR_EOF || ic->pb->eof_reached) |
2572 | 2572 |
eof=1; |
2573 |
- if (url_ferror(ic->pb)) |
|
2573 |
+ if (ic->pb->error) |
|
2574 | 2574 |
break; |
2575 | 2575 |
SDL_Delay(100); /* wait for user event */ |
2576 | 2576 |
continue; |
... | ... |
@@ -743,7 +743,7 @@ static int ff_asf_get_packet(AVFormatContext *s, AVIOContext *pb) |
743 | 743 |
* imply complete -EAGAIN handling support at random positions in |
744 | 744 |
* the stream. |
745 | 745 |
*/ |
746 |
- if (url_ferror(pb) == AVERROR(EAGAIN)) |
|
746 |
+ if (pb->error == AVERROR(EAGAIN)) |
|
747 | 747 |
return AVERROR(EAGAIN); |
748 | 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)); |
... | ... |
@@ -437,6 +437,7 @@ attribute_deprecated int url_fgetc(AVIOContext *s); |
437 | 437 |
* @deprecated use AVIOContext.eof_reached |
438 | 438 |
*/ |
439 | 439 |
attribute_deprecated int url_feof(AVIOContext *s); |
440 |
+attribute_deprecated int url_ferror(AVIOContext *s); |
|
440 | 441 |
#endif |
441 | 442 |
|
442 | 443 |
AVIOContext *avio_alloc_context( |
... | ... |
@@ -499,8 +500,6 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence); |
499 | 499 |
*/ |
500 | 500 |
int64_t avio_size(AVIOContext *s); |
501 | 501 |
|
502 |
-int url_ferror(AVIOContext *s); |
|
503 |
- |
|
504 | 502 |
int av_url_read_fpause(AVIOContext *h, int pause); |
505 | 503 |
int64_t av_url_read_fseek(AVIOContext *h, int stream_index, |
506 | 504 |
int64_t timestamp, int flags); |
... | ... |
@@ -272,7 +272,6 @@ int url_feof(AVIOContext *s) |
272 | 272 |
return 0; |
273 | 273 |
return s->eof_reached; |
274 | 274 |
} |
275 |
-#endif |
|
276 | 275 |
|
277 | 276 |
int url_ferror(AVIOContext *s) |
278 | 277 |
{ |
... | ... |
@@ -280,6 +279,7 @@ int url_ferror(AVIOContext *s) |
280 | 280 |
return 0; |
281 | 281 |
return s->error; |
282 | 282 |
} |
283 |
+#endif |
|
283 | 284 |
|
284 | 285 |
void avio_wl32(AVIOContext *s, unsigned int val) |
285 | 286 |
{ |
... | ... |
@@ -599,7 +599,7 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size) |
599 | 599 |
} |
600 | 600 |
} |
601 | 601 |
if (size1 == size) { |
602 |
- if (url_ferror(s)) return url_ferror(s); |
|
602 |
+ if (s->error) return s->error; |
|
603 | 603 |
if (s->eof_reached) return AVERROR_EOF; |
604 | 604 |
} |
605 | 605 |
return size1 - size; |
... | ... |
@@ -622,7 +622,7 @@ int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size) |
622 | 622 |
memcpy(buf, s->buf_ptr, len); |
623 | 623 |
s->buf_ptr += len; |
624 | 624 |
if (!len) { |
625 |
- if (url_ferror(s)) return url_ferror(s); |
|
625 |
+ if (s->error) return s->error; |
|
626 | 626 |
if (s->eof_reached) return AVERROR_EOF; |
627 | 627 |
} |
628 | 628 |
return len; |
... | ... |
@@ -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 (pb->eof_reached || url_ferror(pb)) |
|
150 |
+ if (pb->eof_reached || pb->error) |
|
151 | 151 |
return AVERROR(EIO); |
152 | 152 |
|
153 | 153 |
if (avio_rl32(pb) != 0xAA55AA55) |
... | ... |
@@ -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 (!s->pb->eof_reached && !url_ferror(s->pb)){ |
|
135 |
+ while (!s->pb->eof_reached && !s->pb->error){ |
|
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); |
... | ... |
@@ -77,7 +77,7 @@ static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size) |
77 | 77 |
AVIOContext *pb = wf->pb_filesystem; |
78 | 78 |
int nread = 0; |
79 | 79 |
|
80 |
- if (wf->error || url_ferror(pb)) |
|
80 |
+ if (wf->error || pb->error) |
|
81 | 81 |
return -1; |
82 | 82 |
if (wf->position >= wf->length || pb->eof_reached) |
83 | 83 |
return 0; |