summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>2010-07-27 07:21:19 -0300
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>2010-07-27 07:21:19 -0300
commitfda35f7ac7cc181e49ce147d3a8e01171b0b9a1e (patch)
tree4c65ffcaa181c93e78f75924ff88164de6ac1185
parent574e6ab423f0bba58c3bc88085d6c406677f76e4 (diff)
gstdatetime: Fix localtime usage
localtime only takes one parameter and returns a statically allocated tm struct. Use it correctly. Fixes #625368
-rw-r--r--gst/gstdatetime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gst/gstdatetime.c b/gst/gstdatetime.c
index d68a397e1b..85b3ff414d 100644
--- a/gst/gstdatetime.c
+++ b/gst/gstdatetime.c
@@ -317,10 +317,11 @@ gst_date_time_new_from_unix_epoch (gint64 t)
memset (&tm, 0, sizeof (tm));
tt = (time_t) t;
+
#ifdef HAVE_LOCALTIME_R
localtime_r (&tt, &tm);
#else
- localtime (&tt, &tm);
+ memcpy (&tm, localtime (&tt), sizeof (struct tm));
#endif
dt = gst_date_time_new (tm.tm_year + 1900,