[Mplayer-cvslog] CVS: main/libmpdemux/realrtsp rmff.h,1.3,1.4 rtsp.c,1.3,1.4 rtsp_session.c,1.3,1.4

Diego Biurrun CVS diego at mplayerhq.hu
Wed Jun 11 18:48:12 CEST 2003


Update of /cvsroot/mplayer/main/libmpdemux/realrtsp
In directory mail:/var/tmp.root/cvs-serv719/libmpdemux/realrtsp

Modified Files:
	rmff.h rtsp.c rtsp_session.c 
Log Message:
Networking support under MinGW.
Patch by flo/yepyep <flodt8 at yahoo.de>.


Index: rmff.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/realrtsp/rmff.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- rmff.h	20 Apr 2003 14:40:38 -0000	1.3
+++ rmff.h	11 Jun 2003 16:48:08 -0000	1.4
@@ -27,9 +27,14 @@
  */
 
 #include <sys/types.h>
+#include "config.h"
+#ifndef HAVE_WINSOCK2
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netdb.h>
+#else
+#include <winsock2.h>
+#endif
 #include <unistd.h>
 #include <stdio.h>
 #include <fcntl.h>

Index: rtsp.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/realrtsp/rtsp.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- rtsp.c	29 May 2003 19:34:01 -0000	1.3
+++ rtsp.c	11 Jun 2003 16:48:08 -0000	1.4
@@ -29,9 +29,15 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <assert.h>
+#include "config.h"
+#ifndef HAVE_WINSOCK2
+#define closesocket close
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netdb.h>
+#else
+#include <winsock2.h>
+#endif
 #include <string.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -119,9 +125,13 @@
   sin.sin_port   = htons(port);
   
   if (connect(s, (struct sockaddr *)&sin, sizeof(sin))==-1 
+#ifndef HAVE_WINSOCK2
       && errno != EINPROGRESS) {
+#else
+      && WSAGetLastError() == WSAEINPROGRESS) {
+#endif
     printf ("rtsp: connect(): %s\n", strerror(errno));
-    close(s);
+    closesocket(s);
     return -1;
   }
 
@@ -163,7 +173,11 @@
     if (n > 0)
       total += n;
     else if (n < 0) {
+#ifndef HAVE_WINSOCK2
       if ((timeout>0) && ((errno == EAGAIN) || (errno == EINPROGRESS))) {
+#else
+      if ((timeout>0) && ((errno == EAGAIN) || (WSAGetLastError() == WSAEINPROGRESS))) {
+#endif
         sleep (1); timeout--;
       } else
         return -1;
@@ -641,7 +655,7 @@
 
 void rtsp_close(rtsp_t *s) {
 
-  if (s->server_state) close(s->s); /* TODO: send a TEAROFF */
+  if (s->server_state) closesocket(s->s); /* TODO: send a TEAROFF */
   if (s->path) free(s->path);
   if (s->host) free(s->host);
   if (s->mrl) free(s->mrl);

Index: rtsp_session.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/realrtsp/rtsp_session.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- rtsp_session.c	28 May 2003 21:40:53 -0000	1.3
+++ rtsp_session.c	11 Jun 2003 16:48:08 -0000	1.4
@@ -26,9 +26,14 @@
  */
 
 #include <sys/types.h>
+#include "config.h"
+#ifndef HAVE_WINSOCK2
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netdb.h>
+#else
+#include <winsock2.h>
+#endif
 #include <unistd.h>
 #include <stdio.h>
 #include <fcntl.h>



More information about the MPlayer-cvslog mailing list