mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Clear stale blacklist in getChunkOperation
Clear stale blacklist in getChunkOperation before getting next variant. This ensures: 1.- Player resilience to failures, always trying to look for a working playlist that allows player to non stop playback. 2.- High quality blacklisted playlists can be reused in case they go up after a failure. Player always trying to provide the best user experience.
This commit is contained in:
parent
f8a9da90e8
commit
4fe62b9b0a
@ -258,6 +258,7 @@ public class HlsChunkSource {
|
||||
if (adaptiveMode == ADAPTIVE_MODE_NONE) {
|
||||
// Do nothing.
|
||||
} else {
|
||||
clearStaleBlacklistedPlaylists();
|
||||
nextVariantIndex = getNextVariantIndex(previousTsChunk, playbackPositionUs);
|
||||
switchingVariant = nextVariantIndex != variantIndex;
|
||||
switchingVariantSpliced = switchingVariant && adaptiveMode == ADAPTIVE_MODE_SPLICE;
|
||||
@ -372,7 +373,6 @@ public class HlsChunkSource {
|
||||
MediaPlaylistChunk playlistChunk = (MediaPlaylistChunk) chunk;
|
||||
mediaPlaylistBlacklistFlags[playlistChunk.variantIndex] = true;
|
||||
mediaPlaylistBlacklistedTimeMs[playlistChunk.variantIndex] = SystemClock.elapsedRealtime();
|
||||
clearStaleBlacklistedPlaylists();
|
||||
if (!allPlaylistsBlacklisted()) {
|
||||
// We've handled the 404/410 by blacklisting the playlist.
|
||||
Log.w(TAG, "Blacklisted playlist (" + responseCode + "): "
|
||||
|
Loading…
x
Reference in New Issue
Block a user