chiark / gitweb /
Abolish shared libdisorder; now we use a static one.
[disorder] / server / speaker.c
index 055b08a7d7f3fd53aa57bfef1fb75bc67f7d392b..1cdbd288bed231c4f6705016aa615650bb17e56f 100644 (file)
@@ -247,7 +247,7 @@ static int formats_equal(const ao_sample_format *a,
 static void idle(void) {
   D(("idle"));
 #if API_ALSA
-  if(pcm) {
+  if(!config->speaker_command && pcm) {
     int  err;
 
     if((err = snd_pcm_nonblock(pcm, 0)) < 0)
@@ -394,6 +394,8 @@ static int activate(void) {
     }
     return 0;
   }
+  if(config->speaker_command)
+    return -1;
 #if API_ALSA
   /* If we need to change format then close the current device. */
   if(pcm && !formats_equal(&playing->format, &pcm_format))
@@ -555,7 +557,7 @@ static void play(size_t frames) {
   else
     avail_bytes = playing->used;
 
-  if(kidfd == -1) {
+  if(!config->speaker_command) {
 #if API_ALSA
     snd_pcm_sframes_t pcm_written_frames;
     size_t avail_frames;
@@ -715,9 +717,10 @@ int main(int argc, char **argv) {
     alsa_slots = -1;
     kid_slot = -1;
     if(ready && !forceplay) {
-      if(kidfd >= 0)
-        kid_slot = addfd(kidfd, POLLOUT);
-      else {
+      if(config->speaker_command) {
+        if(kidfd >= 0)
+          kid_slot = addfd(kidfd, POLLOUT);
+      } else {
 #if API_ALSA
         int retry = 3;