aboutsummaryrefslogtreecommitdiffstats
path: root/src/encoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-26 20:59:11 +0200
committerMax Kellermann <max@duempel.org>2013-09-26 20:59:40 +0200
commit5bc4ab899f444723dbb47915c438d7a8673ef44e (patch)
tree7675554c68665c822ab62b3171f395cd532387e1 /src/encoder
parent44faf1080c944b4b9f579e34346c0b0d56de7da2 (diff)
downloadmpd-5bc4ab899f444723dbb47915c438d7a8673ef44e.tar.gz
mpd-5bc4ab899f444723dbb47915c438d7a8673ef44e.tar.xz
mpd-5bc4ab899f444723dbb47915c438d7a8673ef44e.zip
*Plugin: remove redundant "line %i" from error messages
The MPD core will add this as a prefeix.
Diffstat (limited to 'src/encoder')
-rw-r--r--src/encoder/LameEncoderPlugin.cxx21
-rw-r--r--src/encoder/TwolameEncoderPlugin.cxx21
-rw-r--r--src/encoder/VorbisEncoderPlugin.cxx21
3 files changed, 24 insertions, 39 deletions
diff --git a/src/encoder/LameEncoderPlugin.cxx b/src/encoder/LameEncoderPlugin.cxx
index d3ed49a31..a5b7be483 100644
--- a/src/encoder/LameEncoderPlugin.cxx
+++ b/src/encoder/LameEncoderPlugin.cxx
@@ -68,16 +68,14 @@ LameEncoder::Configure(const config_param &param, Error &error)
if (*endptr != '\0' || quality < -1.0 || quality > 10.0) {
error.Format(config_domain,
"quality \"%s\" is not a number in the "
- "range -1 to 10, line %i",
- value, param.line);
+ "range -1 to 10",
+ value);
return false;
}
if (param.GetBlockValue("bitrate") != nullptr) {
- error.Format(config_domain,
- "quality and bitrate are "
- "both defined (line %i)",
- param.line);
+ error.Set(config_domain,
+ "quality and bitrate are both defined");
return false;
}
} else {
@@ -85,10 +83,8 @@ LameEncoder::Configure(const config_param &param, Error &error)
value = param.GetBlockValue("bitrate");
if (value == nullptr) {
- error.Format(config_domain,
- "neither bitrate nor quality defined "
- "at line %i",
- param.line);
+ error.Set(config_domain,
+ "neither bitrate nor quality defined");
return false;
}
@@ -96,9 +92,8 @@ LameEncoder::Configure(const config_param &param, Error &error)
bitrate = g_ascii_strtoll(value, &endptr, 10);
if (*endptr != '\0' || bitrate <= 0) {
- error.Format(config_domain,
- "bitrate at line %i should be a positive integer",
- param.line);
+ error.Set(config_domain,
+ "bitrate should be a positive integer");
return false;
}
}
diff --git a/src/encoder/TwolameEncoderPlugin.cxx b/src/encoder/TwolameEncoderPlugin.cxx
index a04c2afe2..7931ef413 100644
--- a/src/encoder/TwolameEncoderPlugin.cxx
+++ b/src/encoder/TwolameEncoderPlugin.cxx
@@ -73,16 +73,14 @@ TwolameEncoder::Configure(const config_param &param, Error &error)
if (*endptr != '\0' || quality < -1.0 || quality > 10.0) {
error.Format(config_domain,
"quality \"%s\" is not a number in the "
- "range -1 to 10, line %i",
- value, param.line);
+ "range -1 to 10",
+ value);
return false;
}
if (param.GetBlockValue("bitrate") != nullptr) {
- error.Format(config_domain,
- "quality and bitrate are "
- "both defined (line %i)",
- param.line);
+ error.Set(config_domain,
+ "quality and bitrate are both defined");
return false;
}
} else {
@@ -90,10 +88,8 @@ TwolameEncoder::Configure(const config_param &param, Error &error)
value = param.GetBlockValue("bitrate");
if (value == nullptr) {
- error.Format(config_domain,
- "neither bitrate nor quality defined "
- "at line %i",
- param.line);
+ error.Set(config_domain,
+ "neither bitrate nor quality defined");
return false;
}
@@ -101,9 +97,8 @@ TwolameEncoder::Configure(const config_param &param, Error &error)
bitrate = g_ascii_strtoll(value, &endptr, 10);
if (*endptr != '\0' || bitrate <= 0) {
- error.Format(config_domain,
- "bitrate at line %i should be a positive integer",
- param.line);
+ error.Set(config_domain,
+ "bitrate should be a positive integer");
return false;
}
}
diff --git a/src/encoder/VorbisEncoderPlugin.cxx b/src/encoder/VorbisEncoderPlugin.cxx
index 65a4d47e2..8cc1d480c 100644
--- a/src/encoder/VorbisEncoderPlugin.cxx
+++ b/src/encoder/VorbisEncoderPlugin.cxx
@@ -75,16 +75,14 @@ vorbis_encoder_configure(struct vorbis_encoder *encoder,
encoder->quality > 10.0) {
error.Format(config_domain,
"quality \"%s\" is not a number in the "
- "range -1 to 10, line %i",
- value, param.line);
+ "range -1 to 10",
+ value);
return false;
}
if (param.GetBlockValue("bitrate") != nullptr) {
- error.Format(config_domain,
- "quality and bitrate are "
- "both defined (line %i)",
- param.line);
+ error.Set(config_domain,
+ "quality and bitrate are both defined");
return false;
}
} else {
@@ -92,10 +90,8 @@ vorbis_encoder_configure(struct vorbis_encoder *encoder,
value = param.GetBlockValue("bitrate");
if (value == nullptr) {
- error.Format(config_domain,
- "neither bitrate nor quality defined "
- "at line %i",
- param.line);
+ error.Set(config_domain,
+ "neither bitrate nor quality defined");
return false;
}
@@ -104,9 +100,8 @@ vorbis_encoder_configure(struct vorbis_encoder *encoder,
char *endptr;
encoder->bitrate = g_ascii_strtoll(value, &endptr, 10);
if (*endptr != '\0' || encoder->bitrate <= 0) {
- error.Format(config_domain,
- "bitrate at line %i should be a positive integer",
- param.line);
+ error.Set(config_domain,
+ "bitrate should be a positive integer");
return false;
}
}