Try not adapting before failing with BehindLiveWindowException in Hls
Issue:#1782 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=136025847
This commit is contained in:
parent
64262085a7
commit
ff712aead5
@ -254,6 +254,13 @@ import java.util.Locale;
|
|||||||
// chunkMediaSequence = Util.binarySearchFloor(mediaPlaylist.segments, playbackPositionUs,
|
// chunkMediaSequence = Util.binarySearchFloor(mediaPlaylist.segments, playbackPositionUs,
|
||||||
// true, true) + mediaPlaylist.mediaSequence;
|
// true, true) + mediaPlaylist.mediaSequence;
|
||||||
} else {
|
} else {
|
||||||
|
chunkMediaSequence = getLiveNextChunkSequenceNumber(previous.chunkIndex, oldVariantIndex,
|
||||||
|
newVariantIndex);
|
||||||
|
if (chunkMediaSequence < mediaPlaylist.mediaSequence) {
|
||||||
|
// We try getting the next chunk without adapting in case that's the reason for falling
|
||||||
|
// behind the live window.
|
||||||
|
newVariantIndex = oldVariantIndex;
|
||||||
|
mediaPlaylist = variantPlaylists[newVariantIndex];
|
||||||
chunkMediaSequence = getLiveNextChunkSequenceNumber(previous.chunkIndex, oldVariantIndex,
|
chunkMediaSequence = getLiveNextChunkSequenceNumber(previous.chunkIndex, oldVariantIndex,
|
||||||
newVariantIndex);
|
newVariantIndex);
|
||||||
if (chunkMediaSequence < mediaPlaylist.mediaSequence) {
|
if (chunkMediaSequence < mediaPlaylist.mediaSequence) {
|
||||||
@ -261,6 +268,7 @@ import java.util.Locale;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Not live.
|
// Not live.
|
||||||
if (previous == null) {
|
if (previous == null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user