diff --git a/libavformat/os_support.c b/libavformat/os_support.c index 4d6eb8a74c..17d77a01d5 100644 --- a/libavformat/os_support.c +++ b/libavformat/os_support.c @@ -244,13 +244,16 @@ int ff_poll(struct pollfd *fds, nfds_t numfds, int timeout) n = 0; for (i = 0; i < numfds; i++) { +#if !HAVE_WINSOCK2_H if (fds[i].fd < 0) continue; -#if !HAVE_WINSOCK2_H if (fds[i].fd >= FD_SETSIZE) { errno = EINVAL; return -1; } +#else + if (fds[i].fd == INVALID_SOCKET) + continue; #endif /* !HAVE_WINSOCK2_H */ if (fds[i].events & POLLIN)