basesink: fix clipped start/stop after step
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 4 Jun 2009 15:27:03 +0000 (17:27 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 4 Jun 2009 15:27:03 +0000 (17:27 +0200)
Use the segment helpers to get a more accurate clipped start/stop position after
a stepping operation ended.

libs/gst/base/gstbasesink.c

index 43d0daa..1c56fdc 100644 (file)
@@ -1603,11 +1603,11 @@ handle_stepping (GstBaseSink * sink, GstSegment * segment,
         GST_DEBUG_OBJECT (sink, "step ended, we need clipping");
         step_end = TRUE;
         if (segment->rate > 0.0) {
-          *cstart += end - *rstart;
           *rstart = end;
+          *cstart = gst_segment_to_position (segment, GST_FORMAT_TIME, end);
         } else {
-          *cstop += *rstop - end;
           *rstop = end;
+          *cstop = gst_segment_to_position (segment, GST_FORMAT_TIME, end);
         }
       }
       GST_DEBUG_OBJECT (sink,