summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2015-03-18 10:53:30 +0100
committerWim Taymans <wtaymans@redhat.com>2015-03-18 11:35:42 +0100
commit6e67ad7675c3bd00dae00c5aa20647f7e241802a (patch)
treee77a97c808da5e8d28d2acf6a73a13b6433b392c /gst
parent78bdbadc4eb3c555d810f0c71cc3c1725749e025 (diff)
segment: fix offset handling with non 0 start
The position in the segment is relative to the start but the offset isn't, so subtract the start from the position when setting the offset. Add unit test for this as well.
Diffstat (limited to 'gst')
-rw-r--r--gst/gstsegment.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gst/gstsegment.c b/gst/gstsegment.c
index fc52363f8..2f1b037ad 100644
--- a/gst/gstsegment.c
+++ b/gst/gstsegment.c
@@ -757,7 +757,7 @@ gst_segment_offset_running_time (GstSegment * segment, GstFormat format,
if (position == -1)
return FALSE;
- segment->offset = position;
+ segment->offset = position - segment->start;
}
}
return TRUE;