diff --git a/ChangeLog b/ChangeLog index 874750e4ff..db2affbaed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-10-16 Thomas Vander Stichele + + * gst/gstclock.h: + document potential problem in 2038 + 2005-10-16 Thomas Vander Stichele * gst/gstcaps.c: (gst_caps_intersect): diff --git a/common b/common index e8d4a23bcb..13fb2970eb 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit e8d4a23bcbd07bbdf00f9e35787000e96fff9fc2 +Subproject commit 13fb2970eba070acfad554a1fa7b03a680ed95d6 diff --git a/gst/gstclock.h b/gst/gstclock.h index dd6438dcea..9c0728e938 100644 --- a/gst/gstclock.h +++ b/gst/gstclock.h @@ -114,17 +114,24 @@ typedef gpointer GstClockID; * Convert a GTimeVal to a #GstClockTime. */ #define GST_TIMEVAL_TO_TIME(tv) ((tv).tv_sec * GST_SECOND + (tv).tv_usec * GST_USECOND) + /** * GST_TIME_TO_TIMEVAL: * @t: The GstClockTime to convert * @tv: The target timeval * + * Note: on 32-bit systems, a timeval has a range of only 2^32 - 1 seconds, + * which is about 68 years. Expect trouble if you want to schedule stuff + * in your pipeline for 2038. + * * Convert a GstClockTime to a GTimeVal */ -#define GST_TIME_TO_TIMEVAL(t,tv) \ -G_STMT_START { \ - (tv).tv_sec = ((GstClockTime)(t)) / GST_SECOND; \ - (tv).tv_usec = (((GstClockTime)(t)) - (tv).tv_sec * GST_SECOND) / GST_USECOND; \ +#define GST_TIME_TO_TIMEVAL(t,tv) \ +G_STMT_START { \ + (tv).tv_sec = ((GstClockTime) (t)) / GST_SECOND; \ + (tv).tv_usec = (((GstClockTime) (t)) - \ + ((GstClockTime) (tv).tv_sec) * GST_SECOND) \ + / GST_USECOND; \ } G_STMT_END /**