basesink: improve last_stop calculation
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 14 Dec 2010 18:00:14 +0000 (19:00 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 14 Dec 2010 18:00:14 +0000 (19:00 +0100)
Only update the last_stop value when we had a valid stop position for the
clipping or else the clipping code assumes the stop position extends to the end
of the segment, which makes the position reporting return weird values.

libs/gst/base/gstbasesink.c

index 5517dad..cd8b1a5 100644 (file)
@@ -1962,7 +1962,7 @@ again:
   }
 
   /* set last stop position */
-  if (G_LIKELY (cstop != GST_CLOCK_TIME_NONE))
+  if (G_LIKELY (stop != GST_CLOCK_TIME_NONE && cstop != GST_CLOCK_TIME_NONE))
     gst_segment_set_last_stop (segment, GST_FORMAT_TIME, cstop);
   else
     gst_segment_set_last_stop (segment, GST_FORMAT_TIME, cstart);