Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3159>
GstClockTime chunk_time;
selectedChunk = segment;
- repeat_index = (ts - segment->start) / segment->duration;
+ repeat_index =
+ ((ts - segment->start) +
+ ((GstMediaSegment *) stream->segments->pdata[0])->start) /
+ segment->duration;
chunk_time = segment->start + segment->duration * repeat_index;
GstClockTime chunk_time;
selectedChunk = segment;
- repeat_index = (ts - segment->start) / segment->duration;
+ repeat_index =
+ ((ts - segment->start) +
+ ((GstMediaSegment *) stream->segments->pdata[0])->start) /
+ segment->duration;
chunk_time = segment->start + segment->duration * repeat_index;