playrtp: refuse to play RTP via RTP.
authorRichard Kettlewell <rjk@terraraq.org.uk>
Sun, 31 Jul 2011 11:24:44 +0000 (12:24 +0100)
committerRichard Kettlewell <rjk@terraraq.org.uk>
Sun, 31 Jul 2011 11:24:44 +0000 (12:24 +0100)
playrtp attempting to use the RTP backend becomes the default
situation if no local sound output API is available.  This can happen
using (e.g.)  Fink's GCC 4.4, because it cannot compile Apple's header
files, and so concludes that CoreAudio/AudioHardware.h is not
available.

This is about the minimal possible change to stop playrtp crashing in
this case.  There are a variety of better possible answers.

clients/playrtp.c

index 2ab6790..2bd2452 100644 (file)
@@ -678,6 +678,12 @@ int main(int argc, char **argv) {
     }
   }
   if(config_read(0, NULL)) disorder_fatal(0, "cannot read configuration");
+  if(backend == &uaudio_rtp) {
+    /* This means that you have NO local sound output.  This can happen if you
+     * use a non-Apple GCC on a Mac (because it doesn't know how to compile
+     * CoreAudio/AudioHardware.h). */
+    disorder_fatal(0, "cannot play RTP through RTP");
+  }
   if(!maxbuffer)
     maxbuffer = 2 * minbuffer;
   argc -= optind;