*Plugin: remove redundant "line %i" from error messages
The MPD core will add this as a prefeix.
This commit is contained in:
parent
44faf1080c
commit
5bc4ab899f
@ -68,16 +68,14 @@ LameEncoder::Configure(const config_param ¶m, Error &error)
|
|||||||
if (*endptr != '\0' || quality < -1.0 || quality > 10.0) {
|
if (*endptr != '\0' || quality < -1.0 || quality > 10.0) {
|
||||||
error.Format(config_domain,
|
error.Format(config_domain,
|
||||||
"quality \"%s\" is not a number in the "
|
"quality \"%s\" is not a number in the "
|
||||||
"range -1 to 10, line %i",
|
"range -1 to 10",
|
||||||
value, param.line);
|
value);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (param.GetBlockValue("bitrate") != nullptr) {
|
if (param.GetBlockValue("bitrate") != nullptr) {
|
||||||
error.Format(config_domain,
|
error.Set(config_domain,
|
||||||
"quality and bitrate are "
|
"quality and bitrate are both defined");
|
||||||
"both defined (line %i)",
|
|
||||||
param.line);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -85,10 +83,8 @@ LameEncoder::Configure(const config_param ¶m, Error &error)
|
|||||||
|
|
||||||
value = param.GetBlockValue("bitrate");
|
value = param.GetBlockValue("bitrate");
|
||||||
if (value == nullptr) {
|
if (value == nullptr) {
|
||||||
error.Format(config_domain,
|
error.Set(config_domain,
|
||||||
"neither bitrate nor quality defined "
|
"neither bitrate nor quality defined");
|
||||||
"at line %i",
|
|
||||||
param.line);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,9 +92,8 @@ LameEncoder::Configure(const config_param ¶m, Error &error)
|
|||||||
bitrate = g_ascii_strtoll(value, &endptr, 10);
|
bitrate = g_ascii_strtoll(value, &endptr, 10);
|
||||||
|
|
||||||
if (*endptr != '\0' || bitrate <= 0) {
|
if (*endptr != '\0' || bitrate <= 0) {
|
||||||
error.Format(config_domain,
|
error.Set(config_domain,
|
||||||
"bitrate at line %i should be a positive integer",
|
"bitrate should be a positive integer");
|
||||||
param.line);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,16 +73,14 @@ TwolameEncoder::Configure(const config_param ¶m, Error &error)
|
|||||||
if (*endptr != '\0' || quality < -1.0 || quality > 10.0) {
|
if (*endptr != '\0' || quality < -1.0 || quality > 10.0) {
|
||||||
error.Format(config_domain,
|
error.Format(config_domain,
|
||||||
"quality \"%s\" is not a number in the "
|
"quality \"%s\" is not a number in the "
|
||||||
"range -1 to 10, line %i",
|
"range -1 to 10",
|
||||||
value, param.line);
|
value);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (param.GetBlockValue("bitrate") != nullptr) {
|
if (param.GetBlockValue("bitrate") != nullptr) {
|
||||||
error.Format(config_domain,
|
error.Set(config_domain,
|
||||||
"quality and bitrate are "
|
"quality and bitrate are both defined");
|
||||||
"both defined (line %i)",
|
|
||||||
param.line);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -90,10 +88,8 @@ TwolameEncoder::Configure(const config_param ¶m, Error &error)
|
|||||||
|
|
||||||
value = param.GetBlockValue("bitrate");
|
value = param.GetBlockValue("bitrate");
|
||||||
if (value == nullptr) {
|
if (value == nullptr) {
|
||||||
error.Format(config_domain,
|
error.Set(config_domain,
|
||||||
"neither bitrate nor quality defined "
|
"neither bitrate nor quality defined");
|
||||||
"at line %i",
|
|
||||||
param.line);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,9 +97,8 @@ TwolameEncoder::Configure(const config_param ¶m, Error &error)
|
|||||||
bitrate = g_ascii_strtoll(value, &endptr, 10);
|
bitrate = g_ascii_strtoll(value, &endptr, 10);
|
||||||
|
|
||||||
if (*endptr != '\0' || bitrate <= 0) {
|
if (*endptr != '\0' || bitrate <= 0) {
|
||||||
error.Format(config_domain,
|
error.Set(config_domain,
|
||||||
"bitrate at line %i should be a positive integer",
|
"bitrate should be a positive integer");
|
||||||
param.line);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,16 +75,14 @@ vorbis_encoder_configure(struct vorbis_encoder *encoder,
|
|||||||
encoder->quality > 10.0) {
|
encoder->quality > 10.0) {
|
||||||
error.Format(config_domain,
|
error.Format(config_domain,
|
||||||
"quality \"%s\" is not a number in the "
|
"quality \"%s\" is not a number in the "
|
||||||
"range -1 to 10, line %i",
|
"range -1 to 10",
|
||||||
value, param.line);
|
value);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (param.GetBlockValue("bitrate") != nullptr) {
|
if (param.GetBlockValue("bitrate") != nullptr) {
|
||||||
error.Format(config_domain,
|
error.Set(config_domain,
|
||||||
"quality and bitrate are "
|
"quality and bitrate are both defined");
|
||||||
"both defined (line %i)",
|
|
||||||
param.line);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -92,10 +90,8 @@ vorbis_encoder_configure(struct vorbis_encoder *encoder,
|
|||||||
|
|
||||||
value = param.GetBlockValue("bitrate");
|
value = param.GetBlockValue("bitrate");
|
||||||
if (value == nullptr) {
|
if (value == nullptr) {
|
||||||
error.Format(config_domain,
|
error.Set(config_domain,
|
||||||
"neither bitrate nor quality defined "
|
"neither bitrate nor quality defined");
|
||||||
"at line %i",
|
|
||||||
param.line);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,9 +100,8 @@ vorbis_encoder_configure(struct vorbis_encoder *encoder,
|
|||||||
char *endptr;
|
char *endptr;
|
||||||
encoder->bitrate = g_ascii_strtoll(value, &endptr, 10);
|
encoder->bitrate = g_ascii_strtoll(value, &endptr, 10);
|
||||||
if (*endptr != '\0' || encoder->bitrate <= 0) {
|
if (*endptr != '\0' || encoder->bitrate <= 0) {
|
||||||
error.Format(config_domain,
|
error.Set(config_domain,
|
||||||
"bitrate at line %i should be a positive integer",
|
"bitrate should be a positive integer");
|
||||||
param.line);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -290,16 +290,15 @@ mpd_jack_test_default_device(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static unsigned
|
static unsigned
|
||||||
parse_port_list(int line, const char *source, char **dest, Error &error)
|
parse_port_list(const char *source, char **dest, Error &error)
|
||||||
{
|
{
|
||||||
char **list = g_strsplit(source, ",", 0);
|
char **list = g_strsplit(source, ",", 0);
|
||||||
unsigned n = 0;
|
unsigned n = 0;
|
||||||
|
|
||||||
for (n = 0; list[n] != nullptr; ++n) {
|
for (n = 0; list[n] != nullptr; ++n) {
|
||||||
if (n >= MAX_PORTS) {
|
if (n >= MAX_PORTS) {
|
||||||
error.Format(config_domain,
|
error.Set(config_domain,
|
||||||
"too many port names in line %d",
|
"too many port names");
|
||||||
line);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,8 +309,7 @@ parse_port_list(int line, const char *source, char **dest, Error &error)
|
|||||||
|
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
error.Format(config_domain,
|
error.Format(config_domain,
|
||||||
"at least one port name expected in line %d",
|
"at least one port name expected");
|
||||||
line);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +348,7 @@ mpd_jack_init(const config_param ¶m, Error &error)
|
|||||||
/* configure the source ports */
|
/* configure the source ports */
|
||||||
|
|
||||||
value = param.GetBlockValue("source_ports", "left,right");
|
value = param.GetBlockValue("source_ports", "left,right");
|
||||||
jd->num_source_ports = parse_port_list(param.line, value,
|
jd->num_source_ports = parse_port_list(value,
|
||||||
jd->source_ports, error);
|
jd->source_ports, error);
|
||||||
if (jd->num_source_ports == 0)
|
if (jd->num_source_ports == 0)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -368,7 +366,7 @@ mpd_jack_init(const config_param ¶m, Error &error)
|
|||||||
|
|
||||||
if (value != nullptr) {
|
if (value != nullptr) {
|
||||||
jd->num_destination_ports =
|
jd->num_destination_ports =
|
||||||
parse_port_list(param.line, value,
|
parse_port_list(value,
|
||||||
jd->destination_ports, error);
|
jd->destination_ports, error);
|
||||||
if (jd->num_destination_ports == 0)
|
if (jd->num_destination_ports == 0)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -142,8 +142,8 @@ ShoutOutput::Configure(const config_param ¶m, Error &error)
|
|||||||
if (*test != '\0' || quality < -1.0 || quality > 10.0) {
|
if (*test != '\0' || quality < -1.0 || quality > 10.0) {
|
||||||
error.Format(config_domain,
|
error.Format(config_domain,
|
||||||
"shout quality \"%s\" is not a number in the "
|
"shout quality \"%s\" is not a number in the "
|
||||||
"range -1 to 10, line %i",
|
"range -1 to 10",
|
||||||
value, param.line);
|
value);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user