/** @brief Table of speaker backends */
static const struct speaker_backend *backends[] = {
-#if API_ALSA
+#if HAVE_ALSA_ASOUNDLIB_H
&alsa_backend,
#endif
&command_backend,
&network_backend,
+#if HAVE_COREAUDIO_AUDIOHARDWARE_H
+ &coreaudio_backend,
+#endif
+#if HAVE_SYS_SOUNDCARD_H
+ &oss_backend,
+#endif
0
};
* instead, but the post-poll code will cope even if it's
* device_closed. */
if(device_state == device_open)
- backend->beforepoll();
+ backend->beforepoll(&timeout);
}
/* If any other tracks don't have a full buffer, try to read sample data
* from them. We do this last of all, so that if we run out of slots,
char id[24];
if((fd = accept(listenfd, (struct sockaddr *)&addr, &addrlen)) >= 0) {
+ blocking(fd);
if(read(fd, &l, sizeof l) < 4) {
error(errno, "reading length from inbound connection");
xclose(fd);
int n;
struct sockaddr_un addr;
static const int one = 1;
+ struct speaker_message sm;
set_progname(argv);
if(!setlocale(LC_CTYPE, "")) fatal(errno, "error calling setlocale");
xlisten(listenfd, 128);
nonblock(listenfd);
info("listening on %s", addr.sun_path);
+ memset(&sm, 0, sizeof sm);
+ sm.type = SM_READY;
+ speaker_send(1, &sm);
mainloop();
info("stopped (parent terminated)");
exit(0);