chiark / gitweb /
General-purpose event distribution interface
[disorder] / clients / playrtp.c
index 6496daf5166d8dc586646e73b4acb1df29136775..cbc24aef4118c770762b8eb0379c026132cbc0be 100644 (file)
  * - it is safe to read uint32_t values without a lock protecting them
  */
 
-#include <config.h>
-#include "types.h"
+#include "common.h"
 
 #include <getopt.h>
-#include <stdio.h>
-#include <stdlib.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -62,8 +59,6 @@
 #include <pthread.h>
 #include <locale.h>
 #include <sys/uio.h>
-#include <string.h>
-#include <assert.h>
 #include <errno.h>
 #include <netinet/in.h>
 #include <sys/time.h>
@@ -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);