basesink: use start_time as the step start
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 29 May 2009 14:06:52 +0000 (16:06 +0200)
committerWim Taymans <wim@metal.(none)>
Mon, 1 Jun 2009 11:37:29 +0000 (13:37 +0200)
Use the start_time of the element as the point from where the step operation
starts. This fixes stepping in all paused states.

libs/gst/base/gstbasesink.c

index f717209..4b91497 100644 (file)
@@ -1485,13 +1485,8 @@ start_stepping (GstBaseSink * sink, GstSegment * segment,
   memcpy (current, pending, sizeof (GstStepInfo));
   pending->valid = FALSE;
 
-  /* get the running time of the current segment start and remember it */
-  if (segment->rate > 0.0)
-    current->start =
-        gst_segment_to_running_time (segment, segment->format, segment->start);
-  else
-    current->start =
-        gst_segment_to_running_time (segment, segment->format, segment->stop);
+  /* get the running time of where we paused and remember it */
+  current->start = gst_element_get_start_time (GST_ELEMENT_CAST (sink));
 
   /* set the new rate */
   segment->rate = segment->rate * current->rate;
@@ -1518,7 +1513,6 @@ stop_stepping (GstBaseSink * sink, GstSegment * segment,
 
   GST_DEBUG_OBJECT (sink, "step complete");
 
-
   /* update the segment, discarding what was consumed, running time goes
    * backwards with the duration of the data we skipped. FIXME, this only works
    * in PAUSED. */