From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Fri, 11 Sep 2020 16:31:55 +0000 (+0100) Subject: Add a default name for the pipe backend: /tmp/shairport-sync-audio X-Git-Tag: 3.3.8~16^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=485e18db1786b672c2949ee6b67ce64435e76a9e;p=thirdparty%2Fshairport-sync.git Add a default name for the pipe backend: /tmp/shairport-sync-audio --- diff --git a/audio_pipe.c b/audio_pipe.c index 05c98623..5e82496c 100644 --- a/audio_pipe.c +++ b/audio_pipe.c @@ -42,6 +42,7 @@ static int fd = -1; char *pipename = NULL; +char *default_pipe_name = "/tmp/shairport-sync-audio"; static void start(__attribute__((unused)) int sample_rate, __attribute__((unused)) int sample_format) { @@ -108,16 +109,19 @@ static int init(int argc, char **argv) { if (config_lookup_string(config.cfg, "pipe.name", &str)) { pipename = (char *)str; } - - if ((pipename) && (strcasecmp(pipename, "STDOUT") == 0)) - die("Can't use \"pipe\" backend for STDOUT. Use the \"stdout\" backend instead."); } - if ((pipename == NULL) && (argc != 1)) - die("bad or missing argument(s) to pipe"); + if (argc > 1) + die("too many command-line arguments to pipe"); if (argc == 1) - pipename = strdup(argv[0]); + pipename = argv[0]; // command line argument has priority + + if ((pipename) && (strcasecmp(pipename, "STDOUT") == 0)) + die("Can't use \"pipe\" backend for STDOUT. Use the \"stdout\" backend instead."); + + if (pipename == NULL) + pipename = default_pipe_name; // if none specified // here, create the pipe mode_t oldumask = umask(000); diff --git a/scripts/shairport-sync.conf b/scripts/shairport-sync.conf index efa34996..6444b8a5 100644 --- a/scripts/shairport-sync.conf +++ b/scripts/shairport-sync.conf @@ -159,7 +159,7 @@ jack = // --with-pipe pipe = { -// name = "/path/to/pipe"; // there is no default pipe name for the output +// name = "/tmp/shairport-sync-audio"; // this is the default }; // There are no configuration file parameters for the "stdout" audio back end. No interpolation is done.