aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs/audioOutput_shout.c
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2007-05-26 18:15:54 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2007-05-26 18:15:54 +0000
commitbba444524eca700970f69261bc470fb01a138222 (patch)
tree7d5e302586ed757a6eb3f71a27f84bba60383fd4 /src/audioOutputs/audioOutput_shout.c
parentdba45a59928301da0faa4ec679eb1a3a81d5fba5 (diff)
downloadmpd-bba444524eca700970f69261bc470fb01a138222.tar.gz
mpd-bba444524eca700970f69261bc470fb01a138222.tar.xz
mpd-bba444524eca700970f69261bc470fb01a138222.zip
Changing all calls to ERROR() followed by exit(EXIT_FAILURE) with a single
call to FATAL(). git-svn-id: https://svn.musicpd.org/mpd/trunk@6276 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/audioOutputs/audioOutput_shout.c')
-rw-r--r--src/audioOutputs/audioOutput_shout.c38
1 files changed, 14 insertions, 24 deletions
diff --git a/src/audioOutputs/audioOutput_shout.c b/src/audioOutputs/audioOutput_shout.c
index 01fd50c1b..25966d172 100644
--- a/src/audioOutputs/audioOutput_shout.c
+++ b/src/audioOutputs/audioOutput_shout.c
@@ -100,10 +100,9 @@ static void freeShoutData(ShoutData * sd)
#define checkBlockParam(name) { \
blockParam = getBlockParam(param, name); \
- if(!blockParam) { \
- ERROR("no \"%s\" defined for shout device defined at line " \
+ if (!blockParam) { \
+ FATAL("no \"%s\" defined for shout device defined at line " \
"%i\n", name, param->line); \
- exit(EXIT_FAILURE); \
} \
}
@@ -138,9 +137,8 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param)
port = strtol(blockParam->value, &test, 10);
if (*test != '\0' || port <= 0) {
- ERROR("shout port \"%s\" is not a positive integer, line %i\n",
+ FATAL("shout port \"%s\" is not a positive integer, line %i\n",
blockParam->value, blockParam->line);
- exit(EXIT_FAILURE);
}
checkBlockParam("password");
@@ -151,14 +149,13 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param)
blockParam = getBlockParam(param, "public");
if (blockParam) {
- if (0 == strcmp(blockParam->value, "yes"))
+ if (0 == strcmp(blockParam->value, "yes")) {
public = 1;
- else if (0 == strcmp(blockParam->value, "no"))
+ } else if (0 == strcmp(blockParam->value, "no")) {
public = 0;
- else {
- ERROR("public \"%s\" is not \"yes\" or \"no\" at line "
+ } else {
+ FATAL("public \"%s\" is not \"yes\" or \"no\" at line "
"%i\n", param->value, param->line);
- exit(EXIT_FAILURE);
}
} else
public = 0;
@@ -177,35 +174,31 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param)
sd->quality = strtod(blockParam->value, &test);
if (*test != '\0' || sd->quality < -1.0 || sd->quality > 10.0) {
- ERROR("shout quality \"%s\" is not a number in the "
+ FATAL("shout quality \"%s\" is not a number in the "
"range -1 to 10, line %i\n", blockParam->value,
blockParam->line);
- exit(EXIT_FAILURE);
}
blockParam = getBlockParam(param, "bitrate");
if (blockParam) {
- ERROR("quality (line %i) and bitrate (line %i) are "
+ FATAL("quality (line %i) and bitrate (line %i) are "
"both defined for shout output\n", line,
blockParam->line);
- exit(EXIT_FAILURE);
}
} else {
blockParam = getBlockParam(param, "bitrate");
if (!blockParam) {
- ERROR("neither bitrate nor quality defined for shout "
+ FATAL("neither bitrate nor quality defined for shout "
"output at line %i\n", param->line);
- exit(EXIT_FAILURE);
}
sd->bitrate = strtol(blockParam->value, &test, 10);
if (*test != '\0' || sd->bitrate <= 0) {
- ERROR("bitrate at line %i should be a positive integer "
+ FATAL("bitrate at line %i should be a positive integer "
"\n", blockParam->line);
- exit(EXIT_FAILURE);
}
}
@@ -225,25 +218,22 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param)
shout_set_protocol(sd->shoutConn, SHOUT_PROTOCOL_HTTP)
!= SHOUTERR_SUCCESS ||
shout_set_agent(sd->shoutConn, "MPD") != SHOUTERR_SUCCESS) {
- ERROR("error configuring shout defined at line %i: %s\n",
+ FATAL("error configuring shout defined at line %i: %s\n",
param->line, shout_get_error(sd->shoutConn));
- exit(EXIT_FAILURE);
}
/* optional paramters */
blockParam = getBlockParam(param, "genre");
if (blockParam && shout_set_genre(sd->shoutConn, blockParam->value)) {
- ERROR("error configuring shout defined at line %i: %s\n",
+ FATAL("error configuring shout defined at line %i: %s\n",
param->line, shout_get_error(sd->shoutConn));
- exit(EXIT_FAILURE);
}
blockParam = getBlockParam(param, "description");
if (blockParam && shout_set_description(sd->shoutConn,
blockParam->value)) {
- ERROR("error configuring shout defined at line %i: %s\n",
+ FATAL("error configuring shout defined at line %i: %s\n",
param->line, shout_get_error(sd->shoutConn));
- exit(EXIT_FAILURE);
}
{