GST_SEEK_TYPE_SET, 100, GST_SEEK_TYPE_NONE, -1, &update);
fail_unless (segment.start == 100);
fail_unless (segment.stop == -1);
+ fail_unless (update == TRUE);
/* configure segment to stop relative, should not do anything since
* size is unknown. */
GST_SEEK_TYPE_NONE, 200, GST_SEEK_TYPE_CUR, -100, &update);
fail_unless (segment.start == 100);
fail_unless (segment.stop == -1);
+ fail_unless (update == FALSE);
/* do some clipping on the open range */
/* completely outside */
GST_SEEK_TYPE_CUR, 100, GST_SEEK_TYPE_SET, 300, &update);
fail_unless (segment.start == 200);
fail_unless (segment.stop == 300);
+ fail_unless (update == TRUE);
+ update = FALSE;
/* add 100 to start (to 300), set stop to 200, this is not allowed.
* nothing should be updated in the segment. A g_warning is
* emited. */
GST_SEEK_TYPE_CUR, 100, GST_SEEK_TYPE_SET, 200, &update));
fail_unless (segment.start == 200);
fail_unless (segment.stop == 300);
+ /* update didn't change */
+ fail_unless (update == FALSE);
+ update = TRUE;
/* seek relative to end, should not do anything since size is
* unknown. */
gst_segment_set_seek (&segment, 1.0,
GST_SEEK_TYPE_END, -300, GST_SEEK_TYPE_END, -100, &update);
fail_unless (segment.start == 200);
fail_unless (segment.stop == 300);
+ fail_unless (update == FALSE);
/* completely outside */
res = gst_segment_clip (&segment, GST_FORMAT_BYTES, 0, 50, &cstart, &cstop);
GST_SEEK_TYPE_SET, 100, GST_SEEK_TYPE_NONE, -1, &update);
fail_unless (segment.start == 100);
fail_unless (segment.stop == -1);
+ fail_unless (update == TRUE);
/* configure segment to stop relative, does not update stop
* since we did not set it before. */
GST_SEEK_TYPE_NONE, 200, GST_SEEK_TYPE_CUR, -100, &update);
fail_unless (segment.start == 100);
fail_unless (segment.stop == -1);
+ fail_unless (update == FALSE);
/* do some clipping on the open range */
/* completely outside */
GST_SEEK_TYPE_CUR, 100, GST_SEEK_TYPE_SET, 200, &update);
fail_unless (segment.start == 200);
fail_unless (segment.stop == 200);
+ fail_unless (update == TRUE);
/* seek relative to end */
gst_segment_set_seek (&segment, 1.0,
GST_SEEK_TYPE_END, -100, GST_SEEK_TYPE_END, -20, &update);
fail_unless (segment.start == 100);
fail_unless (segment.stop == 180);
+ fail_unless (update == TRUE);
/* completely outside */
res = gst_segment_clip (&segment, GST_FORMAT_BYTES, 0, 50, &cstart, &cstop);
fail_unless (segment.stop == 100);
fail_unless (segment.time == 0);
fail_unless (segment.last_stop == 100);
+ fail_unless (update == TRUE);
/* update */
gst_segment_set_seek (&segment, -1.0,
fail_unless (segment.stop == 80);
fail_unless (segment.time == 10);
fail_unless (segment.last_stop == 80);
+ fail_unless (update == TRUE);
gst_segment_set_seek (&segment, -1.0,
GST_FORMAT_BYTES,
fail_unless (segment.stop == 80);
fail_unless (segment.time == 20);
fail_unless (segment.last_stop == 80);
+ fail_unless (update == TRUE);
}
GST_END_TEST;