summaryrefslogtreecommitdiff
path: root/src/input/input_net.c
diff options
context:
space:
mode:
authorTim Champagne <tchamp@users.sourceforge.net>2003-05-20 16:23:44 +0000
committerTim Champagne <tchamp@users.sourceforge.net>2003-05-20 16:23:44 +0000
commit2ff0f33b6345f193ef9dbd6547b268c0bc12552a (patch)
tree7cc5933246205fe58d25ffad0c0d4c41a0dce57a /src/input/input_net.c
parentcee76d5b9b53b098178ce66789e0d491406afad2 (diff)
downloadxine-lib-2ff0f33b6345f193ef9dbd6547b268c0bc12552a.tar.gz
xine-lib-2ff0f33b6345f193ef9dbd6547b268c0bc12552a.tar.bz2
This adds http and network input for Win32. I have no idea how to test this under win32 though?
CVS patchset: 4889 CVS date: 2003/05/20 16:23:44
Diffstat (limited to 'src/input/input_net.c')
-rw-r--r--src/input/input_net.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/input/input_net.c b/src/input/input_net.c
index 48bba37e6..1e180d94c 100644
--- a/src/input/input_net.c
+++ b/src/input/input_net.c
@@ -20,7 +20,7 @@
* Read from a tcp network stream over a lan (put a tweaked mp1e encoder the
* other end and you can watch tv anywhere in the house ..)
*
- * $Id: input_net.c,v 1.47 2003/05/15 20:23:17 miguelfreitas Exp $
+ * $Id: input_net.c,v 1.48 2003/05/20 16:23:44 tchamp Exp $
*
* how to set up mp1e for use with this plugin:
*
@@ -48,8 +48,12 @@
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
+
+#ifndef WIN32
#include <arpa/inet.h>
#include <netdb.h>
+#endif
+
#include <errno.h>
#include <sys/time.h>
@@ -63,6 +67,11 @@
xine_log(xine, XINE_LOG_MSG, message, ##args); \
printf(message, ##args); \
}
+#elif defined (WIN32)
+#define LOG_MSG(xine, message, args) { \
+ xine_log(xine, XINE_LOG_MSG, message, #args); \
+ printf(message, #args); \
+ }
#else
#define LOG_MSG(xine, ...) { \
xine_log(xine, XINE_LOG_MSG, __VA_ARGS__); \
@@ -127,7 +136,12 @@ static int host_connect_attempt(struct in_addr ia, int port, xine_t *xine) {
sin.sin_addr = ia;
sin.sin_port = htons(port);
- if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && errno != EINPROGRESS) {
+#ifndef WIN32
+ if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && errno != EINPROGRESS)
+#else
+ if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 && WSAGetLastError != WSAEINPROGRESS)
+#endif
+ {
LOG_MSG (xine, _("input_net: connect(): %s\n"), strerror(errno));
close(s);
return -1;