summaryrefslogtreecommitdiffstats
path: root/libvo/vo_bl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvo/vo_bl.c')
-rw-r--r--libvo/vo_bl.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libvo/vo_bl.c b/libvo/vo_bl.c
index 13102f2d44..d0aaeb9611 100644
--- a/libvo/vo_bl.c
+++ b/libvo/vo_bl.c
@@ -19,17 +19,23 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
-#include <netdb.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <sys/socket.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
-#include <netinet/in.h>
#include "config.h"
+#ifndef HAVE_WINSOCK2
+#define closesocket close
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#else
+#include <winsock2.h>
+#endif
+
#include "video_out.h"
#include "video_out_internal.h"
#include "../mp_msg.h"
@@ -168,7 +174,7 @@ static int udp_init(bl_host_t *h) {
if (connect(h->fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
mp_msg(MSGT_VO, MSGL_ERR, "couldn't connect socket for %s\n",
h->name);
- close(h->fd);
+ closesocket(h->fd);
return 1;
}
return 0;
@@ -180,7 +186,7 @@ static void udp_send(bl_host_t *h) {
}
static void udp_close(bl_host_t *h) {
- close(h->fd);
+ closesocket(h->fd);
}
#define NO_BLS 2