Enable blacklisting for HTTP 416

Where media segments are specified using byte ranges, it makes
sense that a server might return 416 (which we don't consider
for blacklisting) if the segment is unavailable, rather than
the 404 (which we do consider for blacklisting) that we expect
when media segments are only specified using a URL.

Issue: #6775
PiperOrigin-RevId: 286620698
This commit is contained in:
olly 2019-12-20 20:15:27 +00:00 committed by Oliver Woodman
parent 96437611d8
commit f50ed8fd9c

View file

@ -71,6 +71,7 @@ public class DefaultLoadErrorHandlingPolicy implements LoadErrorHandlingPolicy {
int responseCode = ((InvalidResponseCodeException) exception).responseCode;
return responseCode == 404 // HTTP 404 Not Found.
|| responseCode == 410 // HTTP 410 Gone.
|| responseCode == 416 // HTTP 416 Range Not Satisfiable.
? DEFAULT_TRACK_BLACKLIST_MS
: C.TIME_UNSET;
}