summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2017-04-05 13:32:38 (GMT)
committerSebastian Dröge <sebastian@centricular.com>2017-04-05 13:32:38 (GMT)
commitc173771ed2f8e1bfa309e7deca11ba1dbb60c810 (patch)
tree64f644e45ac7ba160e8b59fe949194e6e71988a3
parentddd00c0d2f376b882957859308fcc598967828cf (diff)
downloadgstreamer-c173771ed2f8e1bfa309e7deca11ba1dbb60c810.tar.gz
gstreamer-c173771ed2f8e1bfa309e7deca11ba1dbb60c810.tar.xz
gst: Use GstClockTimeDiff instead of GstClockTime as type for GST_SECOND and friends
They were (signed!) gint64 before because of G_GINT64_CONSTANT() already and they are actually used in signed calculations. With this change we at least ensure that an integer type of the correct size is used for GI (it was using gint before).
-rw-r--r--gst/gstclock.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/gst/gstclock.h b/gst/gstclock.h
index ea9682e..7bd7604 100644
--- a/gst/gstclock.h
+++ b/gst/gstclock.h
@@ -95,31 +95,30 @@ typedef gpointer GstClockID;
*/
#define GST_CLOCK_STIME_IS_VALID(time) (((GstClockTimeDiff)(time)) != GST_CLOCK_STIME_NONE)
-/* FIXME: still need to explicitly force types on the defines below */
/**
- * GST_SECOND: (value 1000000000) (type GstClockTime)
+ * GST_SECOND: (value 1000000000) (type GstClockTimeDiff)
*
* Constant that defines one GStreamer second.
*/
-#define GST_SECOND ((GstClockTime)(G_USEC_PER_SEC * G_GINT64_CONSTANT (1000)))
+#define GST_SECOND ((GstClockTimeDiff)(G_USEC_PER_SEC * G_GINT64_CONSTANT (1000)))
/**
- * GST_MSECOND: (value 1000000) (type GstClockTime)
+ * GST_MSECOND: (value 1000000) (type GstClockTimeDiff)
*
* Constant that defines one GStreamer millisecond.
*/
-#define GST_MSECOND ((GstClockTime)(GST_SECOND / G_GINT64_CONSTANT (1000)))
+#define GST_MSECOND ((GstClockTimeDiff)(GST_SECOND / G_GINT64_CONSTANT (1000)))
/**
- * GST_USECOND: (value 1000) (type GstClockTime)
+ * GST_USECOND: (value 1000) (type GstClockTimeDiff)
*
* Constant that defines one GStreamer microsecond.
*/
-#define GST_USECOND ((GstClockTime)(GST_SECOND / G_GINT64_CONSTANT (1000000)))
+#define GST_USECOND ((GstClockTimeDiff)(GST_SECOND / G_GINT64_CONSTANT (1000000)))
/**
- * GST_NSECOND: (value 1) (type GstClockTime)
+ * GST_NSECOND: (value 1) (type GstClockTimeDiff)
*
* Constant that defines one GStreamer nanosecond
*/
-#define GST_NSECOND ((GstClockTime)(GST_SECOND / G_GINT64_CONSTANT (1000000000)))
+#define GST_NSECOND ((GstClockTimeDiff)(GST_SECOND / G_GINT64_CONSTANT (1000000000)))
/**