[rtmpdump] r79 - in trunk: rtmp.c rtmpdump.c

hyc subversion at mplayerhq.hu
Thu Dec 17 02:10:04 CET 2009


Author: hyc
Date: Thu Dec 17 02:10:04 2009
New Revision: 79

Log:
MinGW portability fixes

Modified:
   trunk/rtmp.c
   trunk/rtmpdump.c

Modified: trunk/rtmp.c
==============================================================================
--- trunk/rtmp.c	Thu Dec 17 00:53:41 2009	(r78)
+++ trunk/rtmp.c	Thu Dec 17 02:10:04 2009	(r79)
@@ -25,17 +25,16 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-
 #include <assert.h>
 
 #ifdef WIN32
 #include <winsock.h>
 #define close(x)	closesocket(x)
+#define setsockopt(a,b,c,d,e)	(setsockopt)(a,b,c,(const char *)d,(int)e)
 #else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
 #include <sys/times.h>
 #endif
 

Modified: trunk/rtmpdump.c
==============================================================================
--- trunk/rtmpdump.c	Thu Dec 17 00:53:41 2009	(r78)
+++ trunk/rtmpdump.c	Thu Dec 17 02:10:04 2009	(r79)
@@ -97,11 +97,13 @@ sigIntHandler(int sig)
   bCtrlC = true;
   LogPrintf("Caught signal: %d, cleaning up, just a second...\n", sig);
   // ignore all these signals now and let the connection close
-  signal(SIGHUP, SIG_IGN);
   signal(SIGINT, SIG_IGN);
-  signal(SIGPIPE, SIG_IGN);
   signal(SIGTERM, SIG_IGN);
+#ifndef WIN32
+  signal(SIGHUP, SIG_IGN);
+  signal(SIGPIPE, SIG_IGN);
   signal(SIGQUIT, SIG_IGN);
+#endif
 }
 
 int
@@ -1100,13 +1102,22 @@ main(int argc, char **argv)
 
   char *flvFile = 0;
 
-  char DEFAULT_FLASH_VER[] = "LNX 10,0,22,87";
+#undef OSS
+#ifdef WIN32
+#define	OSS	"WIN"
+#else
+#define OSS	"LNX"
+#endif
+
+  char DEFAULT_FLASH_VER[] = OSS " 10,0,22,87";
 
-  signal(SIGHUP, sigIntHandler);
   signal(SIGINT, sigIntHandler);
-  signal(SIGPIPE, sigIntHandler);
   signal(SIGTERM, sigIntHandler);
+#ifndef WIN32
+  signal(SIGHUP, sigIntHandler);
+  signal(SIGPIPE, sigIntHandler);
   signal(SIGQUIT, sigIntHandler);
+#endif
 
   /* sleep(30); */
 


More information about the rtmpdump mailing list