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

index ab28c52..963afc9 100644 (file)
@@ -947,7 +947,7 @@ gst_base_audio_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
         timestamp = gst_clock_get_time (clock);
         base_time = GST_ELEMENT_CAST (src)->base_time;
 
-        if (timestamp > base_time)
+        if (GST_CLOCK_DIFF (timestamp, base_time) < 0)
           timestamp -= base_time;
         else
           timestamp = 0;
@@ -972,7 +972,7 @@ gst_base_audio_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
     /* we are not slaved, subtract base_time */
     base_time = GST_ELEMENT_CAST (src)->base_time;
 
-    if (timestamp > base_time) {
+    if (GST_CLOCK_DIFF (timestamp, base_time) < 0) {
       timestamp -= base_time;
       GST_LOG_OBJECT (src,
           "buffer timestamp %" GST_TIME_FORMAT " (base_time %" GST_TIME_FORMAT