From: David Schleef Date: Fri, 13 Feb 2004 23:56:11 +0000 (+0000) Subject: gst/elements/gstfdsrc.c: (gst_fdsrc_get): Use GST_TIME_TO_TIMEVAL() X-Git-Tag: BRANCH-RELEASE-0_7_5-ROOT~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e7335abe30ba395b44a3884d25e3942bca7cd87;p=platform%2Fupstream%2Fgstreamer.git gst/elements/gstfdsrc.c: (gst_fdsrc_get): Use GST_TIME_TO_TIMEVAL() 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!) --- diff --git a/ChangeLog b/ChangeLog index 728e3b3..3f5fd4e 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 6cb2ee8..e733770 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 dee0596..09331f1 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 6cb2ee8..e733770 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;