gst_segment_init (&segment, GST_FORMAT_BYTES);
- /* configure segment to rate 2.0, format does not matter when we don't specify
- * a start or stop position. */
+ /* configure segment to rate 2.0 */
gst_segment_do_seek (&segment, 2.0,
- GST_FORMAT_UNDEFINED,
+ GST_FORMAT_BYTES,
GST_SEEK_FLAG_NONE,
GST_SEEK_TYPE_NONE, -1, GST_SEEK_TYPE_NONE, -1, &update);
fail_unless (segment.format == GST_FORMAT_BYTES);
fail_unless (segment.rate == 2.0);
fail_unless (update == FALSE);
+#if 0
/* 0 is the same in all formats and should not fail */
gst_segment_do_seek (&segment, 2.0,
GST_FORMAT_TIME, GST_SEEK_FLAG_NONE,
gst_segment_do_seek (&segment, 2.0,
GST_FORMAT_TIME, GST_SEEK_FLAG_NONE,
GST_SEEK_TYPE_NONE, -1, GST_SEEK_TYPE_END, 0, &update);
+#endif
/* set a real stop position, this must happen in bytes */
gst_segment_do_seek (&segment, 3.0,
* playback mode.*/
fail_unless (update == FALSE);
+#if 0
/* 0 as relative end is fine too */
gst_segment_do_seek (&segment, 2.0,
GST_FORMAT_TIME, GST_SEEK_FLAG_NONE,
GST_FORMAT_TIME, GST_SEEK_FLAG_NONE,
GST_SEEK_TYPE_NONE, -1, GST_SEEK_TYPE_SET, -1, &update);
fail_unless (segment.stop == -1);
+#endif
/* set some duration, stop -1 END seeks will now work with the
* duration, if the formats match */
segment.duration = 200;
fail_unless (segment.duration == 200);
- /* seek to end in any format with 0 should set the stop to the
- * duration */
+ /* seek to end with 0 should set the stop to the duration */
gst_segment_do_seek (&segment, 2.0,
- GST_FORMAT_TIME, GST_SEEK_FLAG_NONE,
+ GST_FORMAT_BYTES, GST_SEEK_FLAG_NONE,
GST_SEEK_TYPE_NONE, -1, GST_SEEK_TYPE_END, 0, &update);
fail_unless (segment.stop == 200);
fail_unless (segment.duration == 200);
gst_segment_do_seek (&segment, 2.0,
GST_FORMAT_BYTES, GST_SEEK_FLAG_NONE,
GST_SEEK_TYPE_CUR, -300, GST_SEEK_TYPE_END, 0, &update);
+ GST_DEBUG ("%" G_GINT64_FORMAT, segment.start);
fail_unless (segment.start == 0);
fail_unless (segment.stop == 200);
fail_unless (segment.duration == 200);