mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-04 01:32:42 +00:00
gstdatetime: Fix localtime usage
localtime only takes one parameter and returns a statically allocated tm struct. Use it correctly. Fixes #625368
This commit is contained in:
parent
574e6ab423
commit
fda35f7ac7
1 changed files with 2 additions and 1 deletions
|
@ -317,10 +317,11 @@ gst_date_time_new_from_unix_epoch (gint64 t)
|
||||||
|
|
||||||
memset (&tm, 0, sizeof (tm));
|
memset (&tm, 0, sizeof (tm));
|
||||||
tt = (time_t) t;
|
tt = (time_t) t;
|
||||||
|
|
||||||
#ifdef HAVE_LOCALTIME_R
|
#ifdef HAVE_LOCALTIME_R
|
||||||
localtime_r (&tt, &tm);
|
localtime_r (&tt, &tm);
|
||||||
#else
|
#else
|
||||||
localtime (&tt, &tm);
|
memcpy (&tm, localtime (&tt), sizeof (struct tm));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
dt = gst_date_time_new (tm.tm_year + 1900,
|
dt = gst_date_time_new (tm.tm_year + 1900,
|
||||||
|
|
Loading…
Reference in a new issue