diff options
author | Max Kellermann <max@duempel.org> | 2013-10-21 09:48:31 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-21 09:48:31 +0200 |
commit | 8f1ec1dfdf31d70561eb14ae89a2e6cf9291f521 (patch) | |
tree | bbbb131e9d7b092f2994e3536c156206a7b9bbaa /src/encoder/TwolameEncoderPlugin.cxx | |
parent | 222dc8a239f7578cecdcb21523052140aa1192cf (diff) | |
download | mpd-8f1ec1dfdf31d70561eb14ae89a2e6cf9291f521.tar.gz mpd-8f1ec1dfdf31d70561eb14ae89a2e6cf9291f521.tar.xz mpd-8f1ec1dfdf31d70561eb14ae89a2e6cf9291f521.zip |
util/NumberParser: utilities for parsing numbers from ASCII strings
Diffstat (limited to '')
-rw-r--r-- | src/encoder/TwolameEncoderPlugin.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/encoder/TwolameEncoderPlugin.cxx b/src/encoder/TwolameEncoderPlugin.cxx index 6862173f7..543e71d64 100644 --- a/src/encoder/TwolameEncoderPlugin.cxx +++ b/src/encoder/TwolameEncoderPlugin.cxx @@ -22,14 +22,13 @@ #include "EncoderAPI.hxx" #include "AudioFormat.hxx" #include "ConfigError.hxx" +#include "util/NumberParser.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" #include "Log.hxx" #include <twolame.h> -#include <glib.h> - #include <assert.h> #include <string.h> @@ -69,7 +68,7 @@ TwolameEncoder::Configure(const config_param ¶m, Error &error) if (value != nullptr) { /* a quality was configured (VBR) */ - quality = g_ascii_strtod(value, &endptr); + quality = ParseDouble(value, &endptr); if (*endptr != '\0' || quality < -1.0 || quality > 10.0) { error.Format(config_domain, @@ -95,7 +94,7 @@ TwolameEncoder::Configure(const config_param ¶m, Error &error) } quality = -2.0; - bitrate = g_ascii_strtoll(value, &endptr, 10); + bitrate = ParseInt(value, &endptr); if (*endptr != '\0' || bitrate <= 0) { error.Set(config_domain, |