netclientclock: fix timestamp comparission, Fixes #597407
authorTommi Myöhänen <ext-tommi.1.myohanen@nokia.com>
Tue, 13 Oct 2009 16:12:50 +0000 (19:12 +0300)
committerStefan Kost <ensonic@users.sf.net>
Tue, 13 Oct 2009 16:12:50 +0000 (19:12 +0300)
libs/gst/net/gstnetclientclock.c

index c45231c..c1f19b3 100644 (file)
@@ -557,8 +557,10 @@ gst_net_client_clock_new (gchar * name, const gchar * remote_address,
   {
     GstClockTime now = gst_clock_get_time (GST_CLOCK (ret));
 
-    if (now < base_time || now > base_time + GST_SECOND)
+    if (GST_CLOCK_DIFF (now, base_time) > 0 ||
+        GST_CLOCK_DIFF (now, base_time + GST_SECOND) < 0) {
       g_warning ("unable to set the base time, expect sync problems!");
+    }
   }
 
   if ((ret->priv->fdset = gst_poll_new (TRUE)) == NULL)