configure.ac: Check if localtime_r() is available.
Original commit message from CVS: * configure.ac: Check if localtime_r() is available. * ext/pango/gstclockoverlay.c: (gst_clock_overlay_render_time): If localtime_r() is not available, fall back to localtime(). Should fix build on MingW (#393310).
This commit is contained in:
parent
9052dc4681
commit
5fecea65a6
@ -1,3 +1,12 @@
|
|||||||
|
2007-01-08 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* configure.ac:
|
||||||
|
Check if localtime_r() is available.
|
||||||
|
|
||||||
|
* ext/pango/gstclockoverlay.c: (gst_clock_overlay_render_time):
|
||||||
|
If localtime_r() is not available, fall back to localtime(). Should
|
||||||
|
fix build on MingW (#393310).
|
||||||
|
|
||||||
2007-01-08 Tim-Philipp Müller <tim at centricular dot net>
|
2007-01-08 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/subparse/gstsubparse.c: (parse_mdvdsub):
|
* gst/subparse/gstsubparse.c: (parse_mdvdsub):
|
||||||
|
@ -186,6 +186,9 @@ dnl ffmpegcolorspace includes _stdint.h
|
|||||||
dnl also, Windows does not have long long
|
dnl also, Windows does not have long long
|
||||||
AX_CREATE_STDINT_H
|
AX_CREATE_STDINT_H
|
||||||
|
|
||||||
|
dnl *** checks for functions ***
|
||||||
|
AC_CHECK_FUNCS([localtime_r])
|
||||||
|
|
||||||
dnl *** checks for types/defines ***
|
dnl *** checks for types/defines ***
|
||||||
|
|
||||||
dnl Check for FIONREAD ioctl declaration
|
dnl Check for FIONREAD ioctl declaration
|
||||||
|
@ -76,14 +76,22 @@ GST_BOILERPLATE (GstClockOverlay, gst_clock_overlay, GstTextOverlay,
|
|||||||
static gchar *
|
static gchar *
|
||||||
gst_clock_overlay_render_time (GstClockOverlay * overlay)
|
gst_clock_overlay_render_time (GstClockOverlay * overlay)
|
||||||
{
|
{
|
||||||
struct tm t;
|
struct tm dummy, *t;
|
||||||
time_t now;
|
time_t now;
|
||||||
|
|
||||||
now = time (NULL);
|
now = time (NULL);
|
||||||
if (localtime_r (&now, &t) == NULL)
|
|
||||||
|
#ifdef HAVE_LOCALTIME_R
|
||||||
|
t = localtime_r (&now, &dummy);
|
||||||
|
#else
|
||||||
|
/* on win32 this apparently returns a per-thread struct which would be fine */
|
||||||
|
t = localtime (&now);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (t == NULL)
|
||||||
return g_strdup ("--:--:--");
|
return g_strdup ("--:--:--");
|
||||||
|
|
||||||
return g_strdup_printf ("%02u:%02u:%02u", t.tm_hour, t.tm_min, t.tm_sec);
|
return g_strdup_printf ("%02u:%02u:%02u", t->tm_hour, t->tm_min, t->tm_sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Called with lock held */
|
/* Called with lock held */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user