Find correct next chunk if previous one didn't finish loading.

If the previous chunk didn't finish loading, we need to find the appropriate
next chunk based on the current loading position (or the previous chunk's
start time if not independent).

PiperOrigin-RevId: 315658435
This commit is contained in:
tonihei 2020-06-10 10:57:23 +01:00 committed by Oliver Woodman
parent b0457da038
commit b0d98a2e22

View File

@ -505,9 +505,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/* stayInBounds= */ !playlistTracker.isLive() || previous == null)
+ mediaPlaylist.mediaSequence;
}
// We ignore the case of previous not having loaded completely, in which case we load the next
// segment.
return previous.getNextChunkIndex();
return previous.isLoadCompleted() ? previous.getNextChunkIndex() : previous.chunkIndex;
}
private long resolveTimeToLiveEdgeUs(long playbackPositionUs) {