X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/5aff007d8fcfb4c6cc3c3627ae15f45562db7a0d..30fc14d85cf0279d521acce6ec70517ffd910ebe:/clients/playrtp.c diff --git a/clients/playrtp.c b/clients/playrtp.c index 31416ec..cbc24ae 100644 --- a/clients/playrtp.c +++ b/clients/playrtp.c @@ -49,12 +49,9 @@ * - it is safe to read uint32_t values without a lock protecting them */ -#include -#include "types.h" +#include "common.h" #include -#include -#include #include #include #include @@ -62,8 +59,6 @@ #include #include #include -#include -#include #include #include #include @@ -175,18 +170,16 @@ pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; /** @brief Condition variable signalled whenever @ref packets is changed */ pthread_cond_t cond = PTHREAD_COND_INITIALIZER; -#if HAVE_ALSA_ASOUNDLIB_H -# define DEFAULT_BACKEND playrtp_alsa -#elif HAVE_SYS_SOUNDCARD_H || EMPEG_HOST -# define DEFAULT_BACKEND playrtp_oss -#elif HAVE_COREAUDIO_AUDIOHARDWARE_H -# define DEFAULT_BACKEND playrtp_coreaudio -#else -# error No known backend +#if DEFAULT_BACKEND == BACKEND_ALSA +# define DEFAULT_PLAYRTP_BACKEND playrtp_alsa +#elif DEFAULT_BACKEND == BACKEND_OSS +# define DEFAULT_PLAYRTP_BACKEND playrtp_oss +#elif DEFAULT_BACKEND == BACKEND_COREAUDIO +# define DEFAULT_PLAYRTP_BACKEND playrtp_coreaudio #endif /** @brief Backend to play with */ -static void (*backend)(void) = &DEFAULT_BACKEND; +static void (*backend)(void) = DEFAULT_PLAYRTP_BACKEND; HEAP_DEFINE(pheap, struct packet *, lt_packet); @@ -556,14 +549,10 @@ int main(int argc, char **argv) { const char *dumpfile = 0; static const struct addrinfo prefs = { - AI_PASSIVE, - PF_INET, - SOCK_DGRAM, - IPPROTO_UDP, - 0, - 0, - 0, - 0 + .ai_flags = AI_PASSIVE, + .ai_family = PF_INET, + .ai_socktype = SOCK_DGRAM, + .ai_protocol = IPPROTO_UDP }; mem_init();