basesink: Clamp the base time correctly in position reporting
authorJan Schmidt <thaytan@noraisin.net>
Thu, 19 Nov 2009 18:00:05 +0000 (19:00 +0100)
committerJan Schmidt <thaytan@noraisin.net>
Thu, 19 Nov 2009 18:02:22 +0000 (19:02 +0100)
When clamping the base time, correctly use 'now', instead of
'-now' - the intent is to prevent 'now-base' ever being
negative, which would cause a position report outside the segment.

Fixes: #602419

libs/gst/base/gstbasesink.c

index e9c2ca7..b27e90d 100644 (file)
@@ -4386,7 +4386,7 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
   base += accum;
   base += latency;
   if (GST_CLOCK_DIFF (base, now) < 0)
-    base = -now;
+    base = now;
 
   /* for negative rates we need to count back from the segment
    * duration. */