aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-11-04 04:01:04 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-11-04 04:01:04 +0000
commite9f65c9b9879795f27e81fcbf925f13673c5a0d5 (patch)
tree95f94041e9ab8cf5e805dff242decf022a52e097 /src/audioOutputs
parentbf3be036cece1ed86f7f65b3006e680255a5f079 (diff)
downloadmpd-e9f65c9b9879795f27e81fcbf925f13673c5a0d5.tar.gz
mpd-e9f65c9b9879795f27e81fcbf925f13673c5a0d5.tar.xz
mpd-e9f65c9b9879795f27e81fcbf925f13673c5a0d5.zip
shout config: make "user" optional and default to "source", also add optional "public"
git-svn-id: https://svn.musicpd.org/mpd/trunk@2505 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/audioOutputs')
-rw-r--r--src/audioOutputs/audioOutput_shout.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/audioOutputs/audioOutput_shout.c b/src/audioOutputs/audioOutput_shout.c
index 414fcdfde..48571d0e6 100644
--- a/src/audioOutputs/audioOutput_shout.c
+++ b/src/audioOutputs/audioOutput_shout.c
@@ -114,6 +114,7 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param) {
char * user;
char * name;
BlockParam * blockParam;
+ unsigned int public;
sd = newShoutData();
@@ -143,8 +144,21 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param) {
checkBlockParam("name");
name = blockParam->value;
- checkBlockParam("user");
- user = blockParam->value;
+ blockParam = getBlockParam(param, "public");
+ if(blockParam) {
+ if(0 == strcmp(blockParam->value, "yes")) public = 1;
+ else if(0 == strcmp(blockParam->value, "no")) public = 0;
+ else {
+ ERROR("public \"%s\" is not \"yes\" or \"no\" at line "
+ "%i\n", param->value, param->line);
+ exit(EXIT_FAILURE);
+ }
+ }
+ else public = 1;
+
+ blockParam = getBlockParam(param, "user");
+ if(blockParam) user = blockParam->value;
+ else user = "source";
blockParam = getBlockParam(param, "quality");
@@ -196,6 +210,7 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param) {
shout_set_mount(sd->shoutConn, mount) != SHOUTERR_SUCCESS ||
shout_set_name(sd->shoutConn, name) != SHOUTERR_SUCCESS ||
shout_set_user(sd->shoutConn, user) != SHOUTERR_SUCCESS ||
+ shout_set_public(sd->shoutConn, public) != SHOUTERR_SUCCESS ||
shout_set_format(sd->shoutConn, SHOUT_FORMAT_VORBIS)
!= SHOUTERR_SUCCESS ||
shout_set_protocol(sd->shoutConn, SHOUT_PROTOCOL_HTTP)