summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-06-11 16:48:09 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-06-11 16:48:09 +0000
commit6ac4f2256749cc720d79317e8eb1a48a706e2db8 (patch)
treeda82bb05e17c1456bbc891a1d47cb3bddee78c4f /libvo
parent5ccc705d9a256ee7b8297c605838fdc2708b1fd5 (diff)
downloadmpv-6ac4f2256749cc720d79317e8eb1a48a706e2db8.tar.bz2
mpv-6ac4f2256749cc720d79317e8eb1a48a706e2db8.tar.xz
Networking support under MinGW.
Patch by flo/yepyep <flodt8@yahoo.de>. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10282 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-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