diff --git a/rtp.c b/rtp.c index 7dac5b37..beea88e2 100644 --- a/rtp.c +++ b/rtp.c @@ -28,7 +28,9 @@ #include #include #include +#include #include +#include #include #include "common.h" #include "player.h" @@ -102,6 +104,8 @@ static int bind_port(SOCKADDR *remote) { sock = socket(remote->SAFAMILY, SOCK_DGRAM, IPPROTO_UDP); ret = bind(sock, info->ai_addr, info->ai_addrlen); + freeaddrinfo(info); + if (ret < 0) die("could not bind a UDP port!"); diff --git a/rtsp.c b/rtsp.c index 5b7ba6d1..4e0880a3 100644 --- a/rtsp.c +++ b/rtsp.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,12 @@ #include "rtp.h" #include "mdns.h" +// some BSDs (OpenBSD, NetBSD) do not support AI_ADDRCONFIG +// it's not critical anyway, define it to 0 (a no-op) +#ifndef AI_ADDRCONFIG +#define AI_ADDRCONFIG 0 +#endif + // only one thread is allowed to use the player at once. // it monitors the request variable (at least when interrupted) static pthread_mutex_t playing_mutex = PTHREAD_MUTEX_INITIALIZER;