mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Allow regressing media sequence numbers in HLS media playlists
This is techically not allowed by the spec[1] but might still occur in certain scenarios. New playlists with older media sequence numbers are ignored. [1]: HLS draft version 20, section-6.2.1 Issue:#2059 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=139564889
This commit is contained in:
parent
d890c2f48f
commit
cafe603694
1 changed files with 4 additions and 0 deletions
|
|
@ -311,6 +311,10 @@ public final class HlsPlaylistTracker implements Loader.Callback<ParsingLoadable
|
|||
// Playlist has not changed.
|
||||
return oldPlaylist;
|
||||
}
|
||||
if (mediaSequenceOffset < 0) {
|
||||
// Playlist has changed but media sequence has regressed.
|
||||
return oldPlaylist;
|
||||
}
|
||||
if (mediaSequenceOffset <= oldPlaylistSize) {
|
||||
// We can extrapolate the start time of new segments from the segments of the old snapshot.
|
||||
ArrayList<HlsMediaPlaylist.Segment> newSegments = new ArrayList<>(newPlaylistSize);
|
||||
|
|
|
|||
Loading…
Reference in a new issue