mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
segment: take offset into account in _to_position()
Take the offset into account when converting between running-time and segment positions.
This commit is contained in:
parent
6d3fc584d5
commit
f664fbd198
1 changed files with 2 additions and 2 deletions
|
@ -651,7 +651,7 @@ gst_segment_to_position (const GstSegment * segment, GstFormat format,
|
||||||
|
|
||||||
if (G_LIKELY (segment->rate > 0.0)) {
|
if (G_LIKELY (segment->rate > 0.0)) {
|
||||||
/* bring to corrected position in segment */
|
/* bring to corrected position in segment */
|
||||||
result += start;
|
result += start + segment->offset;
|
||||||
|
|
||||||
/* outside of the segment boundary stop */
|
/* outside of the segment boundary stop */
|
||||||
if (G_UNLIKELY (stop != -1 && result > stop))
|
if (G_UNLIKELY (stop != -1 && result > stop))
|
||||||
|
@ -663,7 +663,7 @@ gst_segment_to_position (const GstSegment * segment, GstFormat format,
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* bring to corrected position in segment */
|
/* bring to corrected position in segment */
|
||||||
result = stop - result;
|
result = stop - result - segment->offset;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue