summaryrefslogtreecommitdiff
path: root/gst/gstsegment.c
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2014-01-08 15:23:00 +0100
committerWim Taymans <wtaymans@redhat.com>2014-01-08 15:23:00 +0100
commitf664fbd198e049eeea07ee63067b0439ea6af703 (patch)
tree793eb0f7c47df03ac94c2903ab41c088bf4da03e /gst/gstsegment.c
parent6d3fc584d5573ae99c090bf3d169d4edee6be89a (diff)
segment: take offset into account in _to_position()
Take the offset into account when converting between running-time and segment positions.
Diffstat (limited to 'gst/gstsegment.c')
-rw-r--r--gst/gstsegment.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/gstsegment.c b/gst/gstsegment.c
index 86447f39e..590218e82 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;
}