From 4aeac4b551e2ee0062e5f4a1bdcefa6bec2bfe75 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Mon, 27 Aug 2018 22:32:01 +1000 Subject: [PATCH] gstsegment: Add check for gst_segment_offset_running_time() Add a check for gst_segment_offset_running_time() that values are taken directly from the segment base if possible. --- tests/check/gst/gstsegment.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/check/gst/gstsegment.c b/tests/check/gst/gstsegment.c index f160462..17ad18c 100644 --- a/tests/check/gst/gstsegment.c +++ b/tests/check/gst/gstsegment.c @@ -862,6 +862,15 @@ GST_START_TEST (segment_full) GST_DEBUG ("%" G_GUINT64_FORMAT, rt); fail_unless (rt == 50); + /* Forward jump will be applied directly to the base field */ + fail_unless (gst_segment_offset_running_time (&segment, GST_FORMAT_TIME, + 50) == TRUE); + fail_unless (segment.base == 50); + /* Now there's enough base, a negative offset should come from there */ + fail_unless (gst_segment_offset_running_time (&segment, GST_FORMAT_TIME, + -50) == TRUE); + fail_unless (segment.base == 0); + segment.start = 50; segment.stop = 300; segment.position = 150; -- 2.7.4