aboutsummaryrefslogtreecommitdiffstats
path: root/src/encoder/VorbisEncoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-21 09:48:31 +0200
committerMax Kellermann <max@duempel.org>2013-10-21 09:48:31 +0200
commit8f1ec1dfdf31d70561eb14ae89a2e6cf9291f521 (patch)
treebbbb131e9d7b092f2994e3536c156206a7b9bbaa /src/encoder/VorbisEncoderPlugin.cxx
parent222dc8a239f7578cecdcb21523052140aa1192cf (diff)
downloadmpd-8f1ec1dfdf31d70561eb14ae89a2e6cf9291f521.tar.gz
mpd-8f1ec1dfdf31d70561eb14ae89a2e6cf9291f521.tar.xz
mpd-8f1ec1dfdf31d70561eb14ae89a2e6cf9291f521.zip
util/NumberParser: utilities for parsing numbers from ASCII strings
Diffstat (limited to 'src/encoder/VorbisEncoderPlugin.cxx')
-rw-r--r--src/encoder/VorbisEncoderPlugin.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/encoder/VorbisEncoderPlugin.cxx b/src/encoder/VorbisEncoderPlugin.cxx
index 1a2aa1a03..6831ca877 100644
--- a/src/encoder/VorbisEncoderPlugin.cxx
+++ b/src/encoder/VorbisEncoderPlugin.cxx
@@ -25,6 +25,7 @@
#include "tag/Tag.hxx"
#include "AudioFormat.hxx"
#include "ConfigError.hxx"
+#include "util/NumberParser.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
@@ -67,7 +68,7 @@ vorbis_encoder_configure(struct vorbis_encoder *encoder,
/* a quality was configured (VBR) */
char *endptr;
- encoder->quality = g_ascii_strtod(value, &endptr);
+ encoder->quality = ParseDouble(value, &endptr);
if (*endptr != '\0' || encoder->quality < -1.0 ||
encoder->quality > 10.0) {
@@ -96,7 +97,7 @@ vorbis_encoder_configure(struct vorbis_encoder *encoder,
encoder->quality = -2.0;
char *endptr;
- encoder->bitrate = g_ascii_strtoll(value, &endptr, 10);
+ encoder->bitrate = ParseInt(value, &endptr);
if (*endptr != '\0' || encoder->bitrate <= 0) {
error.Set(config_domain,
"bitrate should be a positive integer");