Mercurial > libavformat.hg
changeset 4035:8c161751e4c7 libavformat
Get rid of MSG_DONTWAIT using a more standard way to use a socket
in a non blocked mode.
Patch by Jindrich Makovicka: makovick gmail
author | benoit |
---|---|
date | Mon, 17 Nov 2008 07:50:25 +0000 |
parents | 608286f429a5 |
children | 1349c277efbd |
files | udp.c |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/udp.c Sun Nov 16 02:56:34 2008 +0000 +++ b/udp.c Mon Nov 17 07:50:25 2008 +0000 @@ -437,6 +437,8 @@ if (setsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, sizeof(tmp)) < 0) { av_log(NULL, AV_LOG_WARNING, "setsockopt(SO_RECVBUF): %s\n", strerror(errno)); } + /* make the socket non-blocking */ + ff_socket_nonblock(udp_fd, 1); } s->udp_fd = udp_fd; @@ -468,7 +470,7 @@ return AVERROR(EIO); if (!(ret > 0 && FD_ISSET(s->udp_fd, &rfds))) continue; - len = recv(s->udp_fd, buf, size, MSG_DONTWAIT); + len = recv(s->udp_fd, buf, size, 0); if (len < 0) { if (ff_neterrno() != FF_NETERROR(EAGAIN) && ff_neterrno() != FF_NETERROR(EINTR))