mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
pango: Call tzset() before localtime_r()
POSIX and your local friendly ctime(3) manual entry says that localtime_r isn't required to set the state variables that define the current timezone. Indeed, glibc (at least 2.9) doesn't do this for subsequent calls. The effect is that if the system timezone is changed for a running program between two calls to gst_clock_overlay_render_time, it won't be noticed. For glibc, changing the timezone equals /etc/localtime being modified. Fixes bug #587676.
This commit is contained in:
parent
8937c89551
commit
04e23f2d6a
1 changed files with 3 additions and 0 deletions
|
@ -97,6 +97,9 @@ gst_clock_overlay_render_time (GstClockOverlay * overlay)
|
|||
now = time (NULL);
|
||||
|
||||
#ifdef HAVE_LOCALTIME_R
|
||||
/* Need to call tzset explicitly when calling localtime_r for changes
|
||||
to the timezone between calls to be visible. */
|
||||
tzset ();
|
||||
t = localtime_r (&now, &dummy);
|
||||
#else
|
||||
/* on win32 this apparently returns a per-thread struct which would be fine */
|
||||
|
|
Loading…
Reference in a new issue