Take the offset into account when converting between running-time and
segment positions.
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))
return -1;
/* bring to corrected position in segment */
- result = stop - result;
+ result = stop - result - segment->offset;
}
return result;
}