Commit 696bb34a by tonihei Committed by Oliver Woodman

Fix second sync point calculation for unbounded live streams.

We currently use INDEX_UNBOUNDED for the calculation and don't
offset the index by the firstSegmentNum if not unbounded.

PiperOrigin-RevId: 348445797
parent 686d11de
......@@ -195,8 +195,12 @@ public class DefaultDashChunkSource implements DashChunkSource {
if (representationHolder.segmentIndex != null) {
long segmentNum = representationHolder.getSegmentNum(positionUs);
long firstSyncUs = representationHolder.getSegmentStartTimeUs(segmentNum);
int segmentCount = representationHolder.getSegmentCount();
long secondSyncUs =
firstSyncUs < positionUs && segmentNum < representationHolder.getSegmentCount() - 1
firstSyncUs < positionUs
&& (segmentCount == DashSegmentIndex.INDEX_UNBOUNDED
|| segmentNum
< representationHolder.getFirstSegmentNum() + segmentCount - 1)
? representationHolder.getSegmentStartTimeUs(segmentNum + 1)
: firstSyncUs;
return seekParameters.resolveSeekPositionUs(positionUs, firstSyncUs, secondSyncUs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment