--- a/gst/hls/m3u8.c
+++ b/gst/hls/m3u8.c
@@ -133,36 +133,6 @@ int_from_string (gchar * ptr, gchar ** endptr, gint * val)
 }
 
 static gboolean
-double_from_string (gchar * ptr, gchar ** endptr, gdouble * val)
-{
-  gchar *end;
-  gdouble ret;
-
-  g_return_val_if_fail (ptr != NULL, FALSE);
-  g_return_val_if_fail (val != NULL, FALSE);
-
-  errno = 0;
-  ret = strtod (ptr, &end);
-  if ((errno == ERANGE && (ret == HUGE_VAL || ret == -HUGE_VAL))
-      || (errno != 0 && ret == 0)) {
-    GST_WARNING ("%s", g_strerror (errno));
-    return FALSE;
-  }
-
-  if (!isfinite (ret)) {
-    GST_WARNING ("%s", g_strerror (ERANGE));
-    return FALSE;
-  }
-
-  if (endptr)
-    *endptr = end;
-
-  *val = (gint) ret;
-
-  return end != ptr;
-}
-
-static gboolean
 parse_attributes (gchar ** ptr, gchar ** a, gchar ** v)
 {
   gchar *end, *p;
@@ -366,8 +336,8 @@ gst_m3u8_update (GstM3U8 * self, gchar * data, gboolean * updated)
       g_free (self->allowcache);
       self->allowcache = g_strdup (data + 19);
     } else if (g_str_has_prefix (data, "#EXTINF:")) {
-      gdouble fval;
-      if (!double_from_string (data + 8, &data, &fval)) {
+      gdouble fval = g_ascii_strtod (data + 8, &data);
+      if (errno == ERANGE) {
         GST_WARNING ("Can't read EXTINF duration");
         goto next_line;
       }
