summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorFrédéric Wang <fred.wang@free.fr>2015-02-12 14:50:15 +0000
committerTim-Philipp Müller <tim@centricular.com>2015-02-12 14:50:15 +0000
commitd7dd0825747abbbda22e8466dd6ba78fa85c0dbe (patch)
treec355cf687d2a1071f2941aa88304b908f58ef00e /plugins
parentae0b12b109310bc5c6304a0afcd606052263eda7 (diff)
fdsrc: use g_ascii_strtoull() to convert size string in uri
sscanf() doesn't handle G_GUINT64_FORMAT well on mingw64 it appears, leading to compiler warnings. https://bugzilla.gnome.org/show_bug.cgi?id=744034
Diffstat (limited to 'plugins')
-rw-r--r--plugins/elements/gstfdsrc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/elements/gstfdsrc.c b/plugins/elements/gstfdsrc.c
index 82b834430..805832855 100644
--- a/plugins/elements/gstfdsrc.c
+++ b/plugins/elements/gstfdsrc.c
@@ -645,12 +645,14 @@ gst_fd_src_uri_set_uri (GstURIHandler * handler, const gchar * uri,
}
if ((q = g_strstr_len (uri, -1, "?"))) {
- gchar *sp;
+ gchar *sp, *end = NULL;
GST_INFO_OBJECT (src, "found ?");
if ((sp = g_strstr_len (q, -1, "size="))) {
- if (sscanf (sp, "size=%" G_GUINT64_FORMAT, &size) != 1) {
+ sp += strlen ("size=");
+ size = g_ascii_strtoull (sp, &end, 10);
+ if ((size == 0 && errno == EINVAL) || size == G_MAXUINT64 || end == sp) {
GST_INFO_OBJECT (src, "parsing size failed");
size = -1;
} else {