gst/elements/gstfdsrc.c: (gst_fdsrc_get): Use GST_TIME_TO_TIMEVAL()
authorDavid Schleef <ds@schleef.org>
Fri, 13 Feb 2004 23:56:11 +0000 (23:56 +0000)
committerDavid Schleef <ds@schleef.org>
Fri, 13 Feb 2004 23:56:11 +0000 (23:56 +0000)
Original commit message from CVS:
* gst/elements/gstfdsrc.c: (gst_fdsrc_get): Use GST_TIME_TO_TIMEVAL()
* gst/gstclock.h: Avoid using 64-bit % operator (slow!)

ChangeLog
gst/elements/gstfdsrc.c
gst/gstclock.h
plugins/elements/gstfdsrc.c

index 728e3b3..3f5fd4e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-13  David Schleef  <ds@schleef.org>
+
+       * 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  <mattias@sudac.org>
 
        reviewed by: David Schleef  <ds@schleef.org>
index 6cb2ee8..e733770 100644 (file)
@@ -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;
index dee0596..09331f1 100644 (file)
@@ -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"
index 6cb2ee8..e733770 100644 (file)
@@ -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;