summaryrefslogtreecommitdiffstats
path: root/stream/librtsp/rtsp_rtp.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-02-04 00:28:17 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-02-04 00:28:17 +0200
commit9790f4e6e72cdc8093be966d3d6e007c8f44a035 (patch)
tree3d4a19a910d34be6ee7cd4841876a4318d5c243d /stream/librtsp/rtsp_rtp.c
parentccf4d9e96cd7aa8506e6632d2a7352ec89b2b9e3 (diff)
parent09bf506c34a73d587c999ce161a0714159e1e5b6 (diff)
downloadmpv-9790f4e6e72cdc8093be966d3d6e007c8f44a035.tar.bz2
mpv-9790f4e6e72cdc8093be966d3d6e007c8f44a035.tar.xz
Merge svn changes up to r28461
Diffstat (limited to 'stream/librtsp/rtsp_rtp.c')
-rw-r--r--stream/librtsp/rtsp_rtp.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/stream/librtsp/rtsp_rtp.c b/stream/librtsp/rtsp_rtp.c
index b782b59cd5..54a2180375 100644
--- a/stream/librtsp/rtsp_rtp.c
+++ b/stream/librtsp/rtsp_rtp.c
@@ -28,7 +28,7 @@
#include "config.h"
-#ifndef HAVE_WINSOCK2_H
+#if !HAVE_WINSOCK2_H
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
@@ -251,7 +251,7 @@ rtcp_connect (int client_port, int server_port, const char* server_hostname)
if (bind (s, (struct sockaddr *) &sin, sizeof (sin)))
{
-#ifndef HAVE_WINSOCK2_H
+#if !HAVE_WINSOCK2_H
if (errno != EINPROGRESS)
#else
if (WSAGetLastError() != WSAEINPROGRESS)
@@ -297,13 +297,11 @@ rtp_connect (char *hostname, int port)
if (!hostname || !strcmp (hostname, "0.0.0.0"))
sin.sin_addr.s_addr = htonl (INADDR_ANY);
else
-#ifndef HAVE_WINSOCK2_H
-#ifdef HAVE_ATON
- inet_aton (hostname, &sin.sin_addr);
-#else
+#if HAVE_INET_PTON
inet_pton (AF_INET, hostname, &sin.sin_addr);
-#endif
-#else
+#elif HAVE_INET_ATON
+ inet_aton (hostname, &sin.sin_addr);
+#elif HAVE_WINSOCK2_H
sin.sin_addr.s_addr = htonl (INADDR_ANY);
#endif
sin.sin_port = htons (port);
@@ -332,7 +330,7 @@ rtp_connect (char *hostname, int port)
/* datagram socket */
if (bind (s, (struct sockaddr *) &sin, sizeof (sin)))
{
-#ifndef HAVE_WINSOCK2_H
+#if !HAVE_WINSOCK2_H
if (errno != EINPROGRESS)
#else
if (WSAGetLastError() != WSAEINPROGRESS)
@@ -386,13 +384,11 @@ is_multicast_address (char *addr)
sin.sin_family = AF_INET;
-#ifndef HAVE_WINSOCK2_H
-#ifdef HAVE_ATON
- inet_aton (addr, &sin.sin_addr);
-#else
+#if HAVE_INET_PTON
inet_pton (AF_INET, addr, &sin.sin_addr);
-#endif
-#else
+#elif HAVE_INET_ATON
+ inet_aton (addr, &sin.sin_addr);
+#elif HAVE_WINSOCK2_H
sin.sin_addr.s_addr = htonl (INADDR_ANY);
#endif