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
This commit is contained in:
parent
bf3be036ce
commit
e9f65c9b98
@ -114,6 +114,7 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param) {
|
|||||||
char * user;
|
char * user;
|
||||||
char * name;
|
char * name;
|
||||||
BlockParam * blockParam;
|
BlockParam * blockParam;
|
||||||
|
unsigned int public;
|
||||||
|
|
||||||
sd = newShoutData();
|
sd = newShoutData();
|
||||||
|
|
||||||
@ -143,8 +144,21 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param) {
|
|||||||
checkBlockParam("name");
|
checkBlockParam("name");
|
||||||
name = blockParam->value;
|
name = blockParam->value;
|
||||||
|
|
||||||
checkBlockParam("user");
|
blockParam = getBlockParam(param, "public");
|
||||||
user = blockParam->value;
|
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");
|
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_mount(sd->shoutConn, mount) != SHOUTERR_SUCCESS ||
|
||||||
shout_set_name(sd->shoutConn, name) != SHOUTERR_SUCCESS ||
|
shout_set_name(sd->shoutConn, name) != SHOUTERR_SUCCESS ||
|
||||||
shout_set_user(sd->shoutConn, user) != 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)
|
shout_set_format(sd->shoutConn, SHOUT_FORMAT_VORBIS)
|
||||||
!= SHOUTERR_SUCCESS ||
|
!= SHOUTERR_SUCCESS ||
|
||||||
shout_set_protocol(sd->shoutConn, SHOUT_PROTOCOL_HTTP)
|
shout_set_protocol(sd->shoutConn, SHOUT_PROTOCOL_HTTP)
|
||||||
|
Loading…
Reference in New Issue
Block a user