changeset 18836:10d3a190d935

network code portability for win32
author ben
date Tue, 27 Jun 2006 19:18:52 +0000
parents 65e867664a43
children 70bcf587a49a
files libmpdemux/librtsp/rtsp_rtp.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/librtsp/rtsp_rtp.c	Tue Jun 27 19:16:43 2006 +0000
+++ b/libmpdemux/librtsp/rtsp_rtp.c	Tue Jun 27 19:18:52 2006 +0000
@@ -381,8 +381,17 @@
     return -1;
   
   sin.sin_family = AF_INET;
-  inet_pton (AF_INET, addr, &sin.sin_addr);
 
+#ifndef HAVE_WINSOCK2
+#ifdef USE_ATON
+    inet_aton (addr, &sin.sin_addr);
+#else
+    inet_pton (AF_INET, addr, &sin.sin_addr);
+#endif
+#else
+    sin.sin_addr.s_addr = htonl (INADDR_ANY);
+#endif
+  
   if ((ntohl (sin.sin_addr.s_addr) >> 28) == 0xe)
     return 1;