Merge pull request #200 from mrpippy/1.0-dev

Compile fixes for OpenBSD, and call freeaddrinfo() in rtp.c
This commit is contained in:
James Laird
2013-04-03 14:51:42 -07:00
2 changed files with 11 additions and 0 deletions
+4
View File
@@ -28,7 +28,9 @@
#include <signal.h>
#include <unistd.h>
#include <memory.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#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!");
+7
View File
@@ -27,6 +27,7 @@
#include <memory.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/select.h>
#include <signal.h>
#include <netdb.h>
@@ -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;