X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/2d0a6606ee8899dfe372bbdc760fd15c14f3fceb..063854700ea54b4fd277e945ee256c33d103f72d:/clients/playrtp.c diff --git a/clients/playrtp.c b/clients/playrtp.c index 2ab6790..61cf6ab 100644 --- a/clients/playrtp.c +++ b/clients/playrtp.c @@ -1,6 +1,6 @@ /* * This file is part of DisOrder. - * Copyright (C) 2007-2009 Richard Kettlewell + * Copyright (C) 2007-2009, 2011, 2013 Richard Kettlewell * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -648,7 +648,6 @@ int main(int argc, char **argv) { logdate = 1; mem_init(); if(!setlocale(LC_CTYPE, "")) disorder_fatal(errno, "error calling setlocale"); - backend = uaudio_apis[0]; while((n = getopt_long(argc, argv, "hVdD:m:x:L:R:aocC:re:P:M", options, 0)) >= 0) { switch(n) { case 'h': help(); @@ -678,6 +677,18 @@ int main(int argc, char **argv) { } } if(config_read(0, NULL)) disorder_fatal(0, "cannot read configuration"); + if(!backend) { + backend = uaudio_default(uaudio_apis, UAUDIO_API_CLIENT); + if(!backend) + disorder_fatal(0, "no default uaudio API found"); + disorder_info("default audio API %s", backend->name); + } + 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; @@ -702,6 +713,8 @@ int main(int argc, char **argv) { default: disorder_fatal(0, "usage: disorder-playrtp [OPTIONS] [[ADDRESS] PORT]"); } + disorder_info("version "VERSION" process ID %lu", + (unsigned long)getpid()); /* Look up address and port */ if(!(res = get_address(&sl, &prefs, &sockname))) exit(1);