summaryrefslogtreecommitdiff
path: root/tests/check/gst/gstsegment.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/check/gst/gstsegment.c')
-rw-r--r--tests/check/gst/gstsegment.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/check/gst/gstsegment.c b/tests/check/gst/gstsegment.c
index 751469d765..ac46b7d52a 100644
--- a/tests/check/gst/gstsegment.c
+++ b/tests/check/gst/gstsegment.c
@@ -977,6 +977,21 @@ GST_START_TEST (segment_full)
fail_unless (gst_segment_position_from_running_time_full (&segment,
GST_FORMAT_TIME, 75, &pos) == -1);
fail_unless (pos == 300); /* Actually -300 */
+
+ /* Test for running time conversion with stop == -1, where
+ * calculations should use the duration instead */
+ segment.rate = -2.0;
+ segment.start = 100;
+ segment.offset = 0;
+ segment.stop = -1;
+ segment.duration = 200;
+ segment.position = 40;
+ segment.base = 100;
+ segment.time = 10000;
+
+ fail_unless (gst_segment_to_running_time_full (&segment, GST_FORMAT_TIME,
+ 150, &rt) == 1);
+ fail_unless (rt == 175);
}
GST_END_TEST;