< prev index next >
modules/media/src/main/native/gstreamer/gstreamer-lite/gstreamer/gst/gstdatetime.c
Print this page
rev 9518 : imported patch 8u.patch
*** 439,456 ****
--- 439,467 ----
gst_date_time_new_from_unix_epoch_local_time (gint64 secs)
{
GstDateTime *dt;
struct tm tm;
time_t tt;
+ #ifdef GSTREAMER_LITE
+ struct tm *tm_tmp = NULL;
+ #endif // GSTREAMER_LITE
memset (&tm, 0, sizeof (tm));
tt = (time_t) secs;
#ifdef HAVE_LOCALTIME_R
localtime_r (&tt, &tm);
#else
+ #ifdef GSTREAMER_LITE
+ tm_tmp = localtime (&tt);
+ if (tm_tmp == NULL) {
+ return NULL;
+ }
+ memcpy (&tm, tm_tmp, sizeof (struct tm));
+ #else // GSTREAMER_LITE
memcpy (&tm, localtime (&tt), sizeof (struct tm));
+ #endif // GSTREAMER_LITE
#endif
dt = gst_date_time_new (0, tm.tm_year + 1900,
tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
gst_date_time_set_local_timezone (dt);
< prev index next >