-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Issue description
@AquilesCanta
I meet this issue with this url:
http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8.
This video play stuck buffering in random time and never come back to ready.
This issue will always appear on any device when playing a little bit longer time.Through the analysis of a period of time I find the issue is that sometime this live stream http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8 HlsMediaPlaylist's mediaSequence suddenly change to start from zero.This behavior leads to HlsPlaylistTracker's func getLatestPlaylistSnapshot always return oldPlaylist,so the Exoplayer stuck at buffering.I think in this case the player should continue to play the live stream or throw an exception and not stuck at buffering.
private HlsMediaPlaylist getLatestPlaylistSnapshot(HlsMediaPlaylist oldPlaylist,
HlsMediaPlaylist loadedPlaylist) {
if (!loadedPlaylist.isNewerThan(oldPlaylist)) {
if (loadedPlaylist.hasEndTag) {
// If the loaded playlist has an end tag but is not newer than the old playlist then we have
// an inconsistent state. This is typically caused by the server incorrectly resetting the
// media sequence when appending the end tag. We resolve this case as best we can by
// returning the old playlist with the end tag appended.
return oldPlaylist.copyWithEndTag();
} else {
return oldPlaylist;
}
}
long startTimeUs = getLoadedPlaylistStartTimeUs(oldPlaylist, loadedPlaylist);
int discontinuitySequence = getLoadedPlaylistDiscontinuitySequence(oldPlaylist, loadedPlaylist);
return loadedPlaylist.copyWith(startTimeUs, discontinuitySequence);
}
Reproduction steps
Play this url http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8 with a little bit longer time.
Version of ExoPlayer being used
latest