dash: Fix computing repeat_index when seeking in stream with a start !=0 on the first fragment

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3159>
This commit is contained in:
Thibault Saunier 2022-09-20 15:32:52 -03:00 committed by GStreamer Marge Bot
parent f7abd81a45
commit 8a9821e805
2 changed files with 8 additions and 2 deletions

View file

@ -1705,7 +1705,10 @@ gst_mpd_client_stream_seek (GstMPDClient * client, GstActiveStream * stream,
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;

View file

@ -1707,7 +1707,10 @@ gst_mpd_client2_stream_seek (GstMPDClient2 * client, GstActiveStream * stream,
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;