mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00: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
1 changed files with 1 additions and 1 deletions
|
|
@ -258,6 +258,7 @@ public class HlsChunkSource {
|
||||||
if (adaptiveMode == ADAPTIVE_MODE_NONE) {
|
if (adaptiveMode == ADAPTIVE_MODE_NONE) {
|
||||||
// Do nothing.
|
// Do nothing.
|
||||||
} else {
|
} else {
|
||||||
|
clearStaleBlacklistedPlaylists();
|
||||||
nextVariantIndex = getNextVariantIndex(previousTsChunk, playbackPositionUs);
|
nextVariantIndex = getNextVariantIndex(previousTsChunk, playbackPositionUs);
|
||||||
switchingVariant = nextVariantIndex != variantIndex;
|
switchingVariant = nextVariantIndex != variantIndex;
|
||||||
switchingVariantSpliced = switchingVariant && adaptiveMode == ADAPTIVE_MODE_SPLICE;
|
switchingVariantSpliced = switchingVariant && adaptiveMode == ADAPTIVE_MODE_SPLICE;
|
||||||
|
|
@ -372,7 +373,6 @@ public class HlsChunkSource {
|
||||||
MediaPlaylistChunk playlistChunk = (MediaPlaylistChunk) chunk;
|
MediaPlaylistChunk playlistChunk = (MediaPlaylistChunk) chunk;
|
||||||
mediaPlaylistBlacklistFlags[playlistChunk.variantIndex] = true;
|
mediaPlaylistBlacklistFlags[playlistChunk.variantIndex] = true;
|
||||||
mediaPlaylistBlacklistedTimeMs[playlistChunk.variantIndex] = SystemClock.elapsedRealtime();
|
mediaPlaylistBlacklistedTimeMs[playlistChunk.variantIndex] = SystemClock.elapsedRealtime();
|
||||||
clearStaleBlacklistedPlaylists();
|
|
||||||
if (!allPlaylistsBlacklisted()) {
|
if (!allPlaylistsBlacklisted()) {
|
||||||
// We've handled the 404/410 by blacklisting the playlist.
|
// We've handled the 404/410 by blacklisting the playlist.
|
||||||
Log.w(TAG, "Blacklisted playlist (" + responseCode + "): "
|
Log.w(TAG, "Blacklisted playlist (" + responseCode + "): "
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue