diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-03-15 16:18:40 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-03-15 16:48:42 +0100 |
commit | 6947b0c42e0649f0c8355442d1732d642e467902 (patch) | |
tree | bffb2d72049108372cbe46273998f3790dc860f0 /libavformat | |
parent | 27293b840ccae95ddb1f4d8af519e7962b0e373d (diff) | |
parent | c76374c6db5f486672f9df223f43e4892bd655c9 (diff) | |
download | ffmpeg-6947b0c42e0649f0c8355442d1732d642e467902.tar.gz |
Merge remote-tracking branch 'newdev/master'
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/applehttp.c | 2 | ||||
-rw-r--r-- | libavformat/applehttpproto.c | 4 | ||||
-rw-r--r-- | libavformat/asfdec.c | 2 | ||||
-rw-r--r-- | libavformat/avio.c | 2 | ||||
-rw-r--r-- | libavformat/avio.h | 6 | ||||
-rw-r--r-- | libavformat/aviobuf.c | 6 | ||||
-rw-r--r-- | libavformat/dsicin.c | 2 | ||||
-rw-r--r-- | libavformat/mxg.c | 2 | ||||
-rw-r--r-- | libavformat/rtpproto.c | 2 | ||||
-rw-r--r-- | libavformat/rtsp.c | 2 | ||||
-rw-r--r-- | libavformat/tcp.c | 6 | ||||
-rw-r--r-- | libavformat/udp.c | 2 | ||||
-rw-r--r-- | libavformat/utils.c | 2 | ||||
-rw-r--r-- | libavformat/wtv.c | 2 |
14 files changed, 23 insertions, 19 deletions
diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c index 5118d03670..231abab87c 100644 --- a/libavformat/applehttp.c +++ b/libavformat/applehttp.c @@ -528,7 +528,7 @@ reload: return AVERROR_EOF; while (av_gettime() - c->last_load_time < c->target_duration*1000000) { if (url_interrupt_cb()) - return AVERROR(EINTR); + return AVERROR_EXIT; usleep(100*1000); } /* Enough time has elapsed since the last reload */ diff --git a/libavformat/applehttpproto.c b/libavformat/applehttpproto.c index 471f94bd2a..4b7e9c72a9 100644 --- a/libavformat/applehttpproto.c +++ b/libavformat/applehttpproto.c @@ -318,7 +318,7 @@ retry: return AVERROR_EOF; while (av_gettime() - s->last_load_time < s->target_duration*1000000) { if (url_interrupt_cb()) - return AVERROR(EINTR); + return AVERROR_EXIT; usleep(100*1000); } goto retry; @@ -328,7 +328,7 @@ retry: ret = url_open(&s->seg_hd, url, URL_RDONLY); if (ret < 0) { if (url_interrupt_cb()) - return AVERROR(EINTR); + return AVERROR_EXIT; av_log(NULL, AV_LOG_WARNING, "Unable to open %s\n", url); s->cur_seq_no++; goto retry; diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index ebbad81d6e..f9bb51c895 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -742,7 +742,7 @@ static int ff_asf_get_packet(AVFormatContext *s, AVIOContext *pb) * imply complete -EAGAIN handling support at random positions in * the stream. */ - if (url_ferror(pb) == AVERROR(EAGAIN)) + if (pb->error == AVERROR(EAGAIN)) return AVERROR(EAGAIN); if (!url_feof(pb)) av_log(s, AV_LOG_ERROR, "ff asf bad header %x at:%"PRId64"\n", c, avio_tell(pb)); diff --git a/libavformat/avio.c b/libavformat/avio.c index 2265549266..5dca68a50c 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -238,7 +238,7 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int fast_retries = FFMAX(fast_retries, 2); len += ret; if (url_interrupt_cb()) - return AVERROR(EINTR); + return AVERROR_EXIT; } return len; } diff --git a/libavformat/avio.h b/libavformat/avio.h index dd4380e4f4..20b5e80e38 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -237,7 +237,7 @@ void url_get_filename(URLContext *h, char *buf, int buf_size); /** * The callback is called in blocking functions to test regulary if - * asynchronous interruption is needed. AVERROR(EINTR) is returned + * asynchronous interruption is needed. AVERROR_EXIT is returned * in this case by the interrupted function. 'NULL' means no interrupt * callback is given. */ @@ -432,6 +432,8 @@ attribute_deprecated int url_fgetc(AVIOContext *s); /** * @} */ + +attribute_deprecated int url_ferror(AVIOContext *s); #endif AVIOContext *avio_alloc_context( @@ -500,8 +502,6 @@ int64_t avio_size(AVIOContext *s); */ int url_feof(AVIOContext *s); -int url_ferror(AVIOContext *s); - int av_url_read_fpause(AVIOContext *h, int pause); int64_t av_url_read_fseek(AVIOContext *h, int stream_index, int64_t timestamp, int flags); diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index e82d89c433..a4f95210bf 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -281,12 +281,14 @@ int url_feof(AVIOContext *s) return s->eof_reached; } +#if FF_API_OLD_AVIO int url_ferror(AVIOContext *s) { if(!s) return 0; return s->error; } +#endif void avio_wl32(AVIOContext *s, unsigned int val) { @@ -606,7 +608,7 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size) } } if (size1 == size) { - if (url_ferror(s)) return url_ferror(s); + if (s->error) return s->error; if (url_feof(s)) return AVERROR_EOF; } return size1 - size; @@ -629,7 +631,7 @@ int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size) memcpy(buf, s->buf_ptr, len); s->buf_ptr += len; if (!len) { - if (url_ferror(s)) return url_ferror(s); + if (s->error) return s->error; if (url_feof(s)) return AVERROR_EOF; } return len; diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c index 328f901463..22233731c5 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 (url_feof(pb) || pb->error) return AVERROR(EIO); if (avio_rl32(pb) != 0xAA55AA55) diff --git a/libavformat/mxg.c b/libavformat/mxg.c index 81ffec6971..e884311bad 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 (!url_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); diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c index 269b1b2726..bca8ab648b 100644 --- a/libavformat/rtpproto.c +++ b/libavformat/rtpproto.c @@ -241,7 +241,7 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size) #else for(;;) { if (url_interrupt_cb()) - return AVERROR(EINTR); + return AVERROR_EXIT; /* build fdset to listen to RTP and RTCP packets */ n = poll(p, 2, 100); if (n > 0) { diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index a24f12bacf..f50650ed8f 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1565,7 +1565,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, for (;;) { if (url_interrupt_cb()) - return AVERROR(EINTR); + return AVERROR_EXIT; if (wait_end && wait_end - av_gettime() < 0) return AVERROR(EAGAIN); max_p = 0; diff --git a/libavformat/tcp.c b/libavformat/tcp.c index b01f0b85bf..83529dfcc4 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -73,8 +73,10 @@ static int tcp_open(URLContext *h, const char *uri, int flags) if (ret < 0) { struct pollfd p = {fd, POLLOUT, 0}; if (ff_neterrno() == AVERROR(EINTR)) { - if (url_interrupt_cb()) + if (url_interrupt_cb()) { + ret = AVERROR_EXIT; goto fail1; + } goto redo; } if (ff_neterrno() != AVERROR(EINPROGRESS) && @@ -84,7 +86,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags) /* wait until we are connected or until abort */ for(;;) { if (url_interrupt_cb()) { - ret = AVERROR(EINTR); + ret = AVERROR_EXIT; goto fail1; } ret = poll(&p, 1, 100); diff --git a/libavformat/udp.c b/libavformat/udp.c index 0196573209..76a0f35099 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -452,7 +452,7 @@ static int udp_read(URLContext *h, uint8_t *buf, int size) for(;;) { if (url_interrupt_cb()) - return AVERROR(EINTR); + return AVERROR_EXIT; ret = poll(&p, 1, 100); if (ret < 0) { if (ff_neterrno() == AVERROR(EINTR)) diff --git a/libavformat/utils.c b/libavformat/utils.c index ccf9c6550e..b6f8af1d09 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2267,7 +2267,7 @@ int av_find_stream_info(AVFormatContext *ic) read_size = 0; for(;;) { if(url_interrupt_cb()){ - ret= AVERROR(EINTR); + ret= AVERROR_EXIT; av_log(ic, AV_LOG_DEBUG, "interrupted\n"); break; } diff --git a/libavformat/wtv.c b/libavformat/wtv.c index ade4a42e1b..0a362dd9da 100644 --- a/libavformat/wtv.c +++ b/libavformat/wtv.c @@ -77,7 +77,7 @@ static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size) AVIOContext *pb = wf->pb_filesystem; int nread = 0; - if (wf->error || url_ferror(pb)) + if (wf->error || pb->error) return -1; if (wf->position >= wf->length || url_feof(pb)) return 0; |