From f664fbd198e049eeea07ee63067b0439ea6af703 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 8 Jan 2014 15:23:00 +0100 Subject: [PATCH] segment: take offset into account in _to_position() Take the offset into account when converting between running-time and segment positions. --- gst/gstsegment.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/gstsegment.c b/gst/gstsegment.c index 86447f3..590218e 100644 --- a/gst/gstsegment.c +++ b/gst/gstsegment.c @@ -651,7 +651,7 @@ gst_segment_to_position (const GstSegment * segment, GstFormat format, if (G_LIKELY (segment->rate > 0.0)) { /* bring to corrected position in segment */ - result += start; + result += start + segment->offset; /* outside of the segment boundary stop */ if (G_UNLIKELY (stop != -1 && result > stop)) @@ -663,7 +663,7 @@ gst_segment_to_position (const GstSegment * segment, GstFormat format, return -1; /* bring to corrected position in segment */ - result = stop - result; + result = stop - result - segment->offset; } return result; } -- 2.7.4