diff options
author | Sebastian Dröge <mail@slomosnail.de> | 2006-12-09 19:27:28 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2006-12-09 19:27:28 +0000 |
commit | 14999998d43450efcb2c9f690c2fa98c0262d017 (patch) | |
tree | e1d8b27cf54b418f1c16d2885f53421751dcfeec | |
parent | 6e9ee0d19a736e2a010c5795c6941ebf55411328 (diff) |
gst/apetag/gstapedemux.c: We need to be able to read and parse any possible floating point string format ("1,234" or ...
Original commit message from CVS:
Patch by: Sebastian Dröge <mail at slomosnail de>
* gst/apetag/gstapedemux.c: (ape_demux_parse_tags):
We need to be able to read and parse any possible floating point string
format ("1,234" or "1.234") irrespective of the current locale. g_strod()
will parse the former only in certain locales though, so we really need
to canonicalise the separator to '.' and then use g_ascii_strtod() to
make sure we can parse either version at all times.
Fixes #382982 for real.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | gst/apetag/gstapedemux.c | 6 |
2 files changed, 17 insertions, 1 deletions
@@ -1,3 +1,15 @@ +2006-12-09 Tim-Philipp Müller <tim at centricular dot net> + + Patch by: Sebastian Dröge <mail at slomosnail de> + + * gst/apetag/gstapedemux.c: (ape_demux_parse_tags): + We need to be able to read and parse any possible floating point string + format ("1,234" or "1.234") irrespective of the current locale. g_strod() + will parse the former only in certain locales though, so we really need + to canonicalise the separator to '.' and then use g_ascii_strtod() to + make sure we can parse either version at all times. + Fixes #382982 for real. + 2006-12-08 Jan Schmidt <thaytan@mad.scientist.com> * sys/sunaudio/gstsunaudiomixerctrl.c: diff --git a/gst/apetag/gstapedemux.c b/gst/apetag/gstapedemux.c index 73f9e467..87c1c675 100644 --- a/gst/apetag/gstapedemux.c +++ b/gst/apetag/gstapedemux.c @@ -280,7 +280,11 @@ ape_demux_parse_tags (const guint8 * data, gint size) gdouble v_double; gchar *endptr; - v_double = g_strtod (val, &endptr); + /* floating point strings can be "4,123" or "4.123" depending on + * the locale. We need to be able to parse and read either version + * no matter what our current locale is */ + g_strdelimit (val, ",", '.'); + v_double = g_ascii_strtod (val, &endptr); if (endptr != val) { g_value_init (&v, G_TYPE_DOUBLE); g_value_set_double (&v, v_double); |