From 1e28a6937131f4b09be6464aefe3dbfbeef89086 Mon Sep 17 00:00:00 2001 From: Kwang Yul Seo Date: Sun, 9 Dec 2007 05:02:17 +0000 Subject: Fix compilation with MSVC by using gst_util_guint64_to_gdouble() and checking for rint() and implementing it ourself ... Original commit message from CVS: Based on a patch by: Kwang Yul Seo * configure.ac: * ext/cairo/gsttimeoverlay.c: (gst_cairo_time_overlay_print_smpte_time): Fix compilation with MSVC by using gst_util_guint64_to_gdouble() and checking for rint() and implementing it ourself if it doesn't exist. --- ext/cairo/gsttimeoverlay.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/cairo/gsttimeoverlay.c b/ext/cairo/gsttimeoverlay.c index 16707916..8f1d03d1 100644 --- a/ext/cairo/gsttimeoverlay.c +++ b/ext/cairo/gsttimeoverlay.c @@ -48,6 +48,10 @@ #include +#ifndef HAVE_RINT +#define rint(x) ((double) floor((x)+(((x) < 0)? -0.5 : 0.5))) +#endif + static const GstElementDetails cairo_time_overlay_details = GST_ELEMENT_DETAILS ("Time overlay", "Filter/Editor/Video", @@ -159,7 +163,7 @@ gst_cairo_time_overlay_print_smpte_time (guint64 time) int ms; double x; - x = rint ((time + 500000) * 1e-6); + x = rint (gst_util_guint64_to_gdouble (time + 500000) * 1e-6); hours = floor (x / (60 * 60 * 1000)); x -= hours * 60 * 60 * 1000; -- cgit