aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGil Pedersen <gil@cmi.aau.dk>2011-04-28 10:27:40 +0300
committerMartin Storsjö <martin@martin.st>2011-04-28 10:28:51 +0300
commitf2c85458c411447f006f9c928cb198ec0260255a (patch)
tree002c958572da0e2aeba9f82982f7aaf2bc2a3e8c
parentf8fec0505294a4c05e5cfd9323e04258db465314 (diff)
downloadffmpeg-f2c85458c411447f006f9c928cb198ec0260255a.tar.gz
network: Check POLLERR and POLLHUP in ff_network_wait_fd
Previously, the function would lead to an infinite wait (by returning AVERROR(EAGAIN)) on sockets indicating an error via either of these poll flags. Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--libavformat/network.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/network.h b/libavformat/network.h
index 84a8f539d9..881384c943 100644
--- a/libavformat/network.h
+++ b/libavformat/network.h
@@ -78,7 +78,7 @@ static inline int ff_network_wait_fd(int fd, int write)
struct pollfd p = { .fd = fd, .events = ev, .revents = 0 };
int ret;
ret = poll(&p, 1, 100);
- return ret < 0 ? ff_neterrno() : p.revents & ev ? 0 : AVERROR(EAGAIN);
+ return ret < 0 ? ff_neterrno() : p.revents & (ev | POLLERR | POLLHUP) ? 0 : AVERROR(EAGAIN);
}
static inline void ff_network_close(void)