diff options
author | Martin Storsjö <martin@martin.st> | 2011-02-19 19:14:11 +0100 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-02-23 07:21:31 -0500 |
commit | 28c4741a6617a4c1d2490cb13fc70ae4c9c472da (patch) | |
tree | 492c04df564f16ba9fd634c29eb4ea69154dab87 /libavformat/rtpproto.c | |
parent | 8f935b9271052be8f97d655081b94b68b6c23bfb (diff) | |
download | ffmpeg-28c4741a6617a4c1d2490cb13fc70ae4c9c472da.tar.gz |
libavformat: Remove FF_NETERRNO()
Map EAGAIN and EINTR from ff_neterrno to the normal AVERROR()
error codes. Provide fallback definitions of other errno.h network
errors, mapping them to the corresponding winsock errors.
This eases catching these error codes in common code, without having
to distinguish between FF_NETERRNO(EAGAIN) and AVERROR(EAGAIN).
This fixes roundup issue 2614, unbreaking blocking network IO on
windows.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavformat/rtpproto.c')
-rw-r--r-- | libavformat/rtpproto.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c index dd5bc71c0e..269b1b2726 100644 --- a/libavformat/rtpproto.c +++ b/libavformat/rtpproto.c @@ -231,8 +231,8 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size) len = recvfrom (s->rtp_fd, buf, size, 0, (struct sockaddr *)&from, &from_len); if (len < 0) { - if (ff_neterrno() == FF_NETERROR(EAGAIN) || - ff_neterrno() == FF_NETERROR(EINTR)) + if (ff_neterrno() == AVERROR(EAGAIN) || + ff_neterrno() == AVERROR(EINTR)) continue; return AVERROR(EIO); } @@ -251,8 +251,8 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size) len = recvfrom (s->rtcp_fd, buf, size, 0, (struct sockaddr *)&from, &from_len); if (len < 0) { - if (ff_neterrno() == FF_NETERROR(EAGAIN) || - ff_neterrno() == FF_NETERROR(EINTR)) + if (ff_neterrno() == AVERROR(EAGAIN) || + ff_neterrno() == AVERROR(EINTR)) continue; return AVERROR(EIO); } @@ -264,15 +264,15 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size) len = recvfrom (s->rtp_fd, buf, size, 0, (struct sockaddr *)&from, &from_len); if (len < 0) { - if (ff_neterrno() == FF_NETERROR(EAGAIN) || - ff_neterrno() == FF_NETERROR(EINTR)) + if (ff_neterrno() == AVERROR(EAGAIN) || + ff_neterrno() == AVERROR(EINTR)) continue; return AVERROR(EIO); } break; } } else if (n < 0) { - if (ff_neterrno() == FF_NETERROR(EINTR)) + if (ff_neterrno() == AVERROR(EINTR)) continue; return AVERROR(EIO); } |