From: Andre Date: Fri, 24 Feb 2006 15:13:57 +0000 (+0100) Subject: Use whitespace instead of colons to separate receiver/filter args X-Git-Tag: v0.2.11~47^2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=5faeb758fb5c47e5e75a9dbbee60a541e7e2461f Use whitespace instead of colons to separate receiver/filter args This is much nicer but the receiver/filter argument must now be quoted if any options are present. --- diff --git a/INSTALL b/INSTALL index 9d82c9bf..9bf20154 100644 --- a/INSTALL +++ b/INSTALL @@ -115,19 +115,19 @@ on client_host: mp3: - para_recv -r http:-i:server_host | para_filter -f mp3 -f wav | para_play - or - mpg123 http://server_host:8000/ - or - xmms http://server_host:8000/ + para_recv -r 'http -i server_host' | para_filter -f mp3dec -f wav | para_play + or + mpg123 http://server_host:8000/ + or + xmms http://server_host:8000/ ogg: - para_recv -r http:-i:server_host | para_filter -f ogg -f wav | para_play + para_recv -r 'http -i server_host' | para_filter -f oggdec -f wav | para_play If this works, proceede. Otherwise doublecheck what is logged by -para_server and use the --loglevel option of para_recv to increase -verbosity. +para_server and use the --loglevel option of para_recv, para_filter +to increase verbosity. Configure para_audiod ~~~~~~~~~~~~~~~~~~~~~ @@ -142,7 +142,7 @@ the audio stream. Try for help. Usually you have to specify at least server_host as the receiver specifier, like this: - -r http:-i:server_host + -r 'mp3:http -i server_host' The prefered way to use para_audiod is to run it once at system start as an unprivileged user. para_audiod needs to create a "well-known" diff --git a/audiod.ggo b/audiod.ggo index cafc8519..b0b8d0c4 100644 --- a/audiod.ggo +++ b/audiod.ggo @@ -24,13 +24,15 @@ option "receiver" r "Select receiver. May be given multiple times, once for each supported audio format. receiver_spec -consists of an audio format, the receiver -name and any options for that receiver, -seperated by colons. +consists of an audio format and the receiver +name, separated by a colon, and any options +for that receiver, seperated by whitespace. +If any receiver options are present, the +whole receiver argument must be quoted. Example: --r mp3:http:-i:www.paraslash.org:-p:8009 +-r 'mp3:http -i www.paraslash.org -p 8009' " string typestr="receiver_spec" default="http" no multiple @@ -50,12 +52,11 @@ option "filter" f "Select filter(s) manually. May be given multiple times. filter_spec consists of an audio format, the name of the -filter, and any options for that filter, -separated by colons. +filter, and any options for that filter. Examples: -f mp3:mp3dec - -f:mp3:compress:--anticlip:--volume:2 + -f 'mp3:compress --anticlip --volume 2' Note that these options are ignored by default, see --no_default_filters." diff --git a/filter_chain.c b/filter_chain.c index d22ef28e..d59ff709 100644 --- a/filter_chain.c +++ b/filter_chain.c @@ -196,7 +196,7 @@ static int parse_filter_args(int filter_num, char *options, void **conf) return options? -E_BAD_FILTER_OPTIONS : filter_num; if (options) { // PARA_DEBUG_LOG("options: %s\n", options); - argc = split_args(options, &argv, ':'); + argc = split_args(options, &argv, ' '); // PARA_DEBUG_LOG("argc = %d, argv[0]: %s\n", argc, argv[0]); for (i = argc; i >= 0; i--) argv[i + 1] = argv[i]; @@ -242,7 +242,7 @@ int check_filter_arg(char *fa, void **conf) if (strncmp(name, fa, len)) continue; c = fa[len]; - if (c && c != ':') + if (c && c != ' ') continue; if (c && !filters[j].parse_config) return -E_BAD_FILTER_OPTIONS; diff --git a/recv.ggo b/recv.ggo index b6d5a77c..ed903fd6 100644 --- a/recv.ggo +++ b/recv.ggo @@ -2,10 +2,10 @@ option "loglevel" l "set loglevel (0-6)" int typestr="level" default="4" no option "list_receivers" L "print list of available receivers" flag off option "receiver" r "Select receiver. -If options for the selected receiver are given, they must -be separated by ':' instead of white space. Example: +Any options for the selected receiver must +be quoted. Example: - -r http:-i:www.paraslash.org:-p:8009 + -r 'http -i www.paraslash.org -p 8009' " string typestr="receiver_spec" default="http" no diff --git a/recv_common.c b/recv_common.c index 3a09e7c0..39a84087 100644 --- a/recv_common.c +++ b/recv_common.c @@ -39,7 +39,7 @@ static void *parse_receiver_args(int receiver_num, char *options) // options? options : "(none)"); if (options) { // PARA_DEBUG_LOG("%s options: %s\n", name, options); - argc = split_args(options, &argv, ':'); + argc = split_args(options, &argv, ' '); // PARA_DEBUG_LOG("argc = %d, argv[0]: %s\n", fn->argc, fn->argv[0]); for (i = argc; i >= 0; i--) argv[i + 1] = argv[i]; @@ -74,13 +74,13 @@ void *check_receiver_arg(char *ra, int *receiver_num) if (strncmp(name, ra, len)) continue; c = ra[len]; - if (c && c != ':') + if (c && c != ' ') continue; if (c && !receivers[j].parse_config) return NULL; *receiver_num = j; return parse_receiver_args(j, c? ra + len + 1: NULL); } - PARA_ERROR_LOG("%s", "receiver not found:"); + PARA_ERROR_LOG("%s", "receiver not found\n"); return NULL; }