mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
flvdemux: fix date parsing when there are trailing spaces
Fixes parsing of "Thu May 11 15:57:46 2006 ". https://bugzilla.gnome.org/show_bug.cgi?id=767496
This commit is contained in:
parent
b4a4fa19a1
commit
c51831a245
1 changed files with 6 additions and 2 deletions
|
@ -255,13 +255,17 @@ parse_flv_demux_parse_date_string (const gchar * s)
|
|||
GstDateTime *dt = NULL;
|
||||
gchar **tokens;
|
||||
guint64 d;
|
||||
gchar *endptr;
|
||||
gchar *endptr, *stripped;
|
||||
gint i, hh, mm, ss;
|
||||
gint year = -1, month = -1, day = -1;
|
||||
gint hour = -1, minute = -1, seconds = -1;
|
||||
|
||||
stripped = g_strstrip (g_strdup (s));
|
||||
|
||||
/* "Fri Oct 15 15:13:16 2004" needs to be parsed */
|
||||
tokens = g_strsplit (s, " ", -1);
|
||||
tokens = g_strsplit (stripped, " ", -1);
|
||||
|
||||
g_free (stripped);
|
||||
|
||||
if (g_strv_length (tokens) != 5)
|
||||
goto out;
|
||||
|
|
Loading…
Reference in a new issue