Commit ff712aea by aquilescanta Committed by Oliver Woodman

Try not adapting before failing with BehindLiveWindowException in Hls

Issue:#1782

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136025847
parent 64262085
...@@ -257,10 +257,18 @@ import java.util.Locale; ...@@ -257,10 +257,18 @@ import java.util.Locale;
chunkMediaSequence = getLiveNextChunkSequenceNumber(previous.chunkIndex, oldVariantIndex, chunkMediaSequence = getLiveNextChunkSequenceNumber(previous.chunkIndex, oldVariantIndex,
newVariantIndex); newVariantIndex);
if (chunkMediaSequence < mediaPlaylist.mediaSequence) { 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,
newVariantIndex);
if (chunkMediaSequence < mediaPlaylist.mediaSequence) {
fatalError = new BehindLiveWindowException(); fatalError = new BehindLiveWindowException();
return; return;
} }
} }
}
} else { } else {
// Not live. // Not live.
if (previous == null) { if (previous == null) {
......
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