Skip to content

Commit

Permalink
Merge pull request mikebrady#200 from mrpippy/1.0-dev
Browse files Browse the repository at this point in the history
Compile fixes for OpenBSD, and call freeaddrinfo() in rtp.c
  • Loading branch information
abrasive committed Apr 3, 2013
2 parents 171e5d4 + 883d462 commit ae3fcd1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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!");

Expand Down
7 changes: 7 additions & 0 deletions rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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;
Expand Down

0 comments on commit ae3fcd1

Please sign in to comment.