diff --git a/ChangeLog b/ChangeLog index 728e3b3afb..3f5fd4e3b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-02-13 David Schleef + + * gst/elements/gstfdsrc.c: (gst_fdsrc_get): Use GST_TIME_TO_TIMEVAL() + * gst/gstclock.h: Avoid using 64-bit % operator (slow!) + 2004-02-13 Mattias Wadman reviewed by: David Schleef diff --git a/gst/elements/gstfdsrc.c b/gst/elements/gstfdsrc.c index 6cb2ee82c6..e7337705e8 100644 --- a/gst/elements/gstfdsrc.c +++ b/gst/elements/gstfdsrc.c @@ -193,8 +193,7 @@ gst_fdsrc_get(GstPad *pad) if (src->timeout != 0) { - tp->tv_sec = src->timeout / 1000000000; - tp->tv_usec = src->timeout - t.tv_sec * 1000000000; + GST_TIME_TO_TIMEVAL (src->timeout, t); } else tp = NULL; diff --git a/gst/gstclock.h b/gst/gstclock.h index dee05965e4..09331f1fff 100644 --- a/gst/gstclock.h +++ b/gst/gstclock.h @@ -52,7 +52,7 @@ typedef gpointer GstClockID; #define GST_TIME_TO_TIMEVAL(t,tv) \ G_STMT_START { \ (tv).tv_sec = (t) / GST_SECOND; \ - (tv).tv_usec = ((t) / GST_USECOND) % GST_MSECOND; \ + (tv).tv_usec = ((t) - (tv).tv_sec * GST_SECOND) / GST_USECOND; \ } G_STMT_END #define GST_CLOCK_ENTRY_TRACE_NAME "GstClockEntry" diff --git a/plugins/elements/gstfdsrc.c b/plugins/elements/gstfdsrc.c index 6cb2ee82c6..e7337705e8 100644 --- a/plugins/elements/gstfdsrc.c +++ b/plugins/elements/gstfdsrc.c @@ -193,8 +193,7 @@ gst_fdsrc_get(GstPad *pad) if (src->timeout != 0) { - tp->tv_sec = src->timeout / 1000000000; - tp->tv_usec = src->timeout - t.tv_sec * 1000000000; + GST_TIME_TO_TIMEVAL (src->timeout, t); } else tp = NULL;