Commit 1a5d79b7 by bachinger Committed by Oliver Woodman

Schedule load for non-primary playlist for low latency streams

Low latency streams potentially need to remove preload chunks in case they are removed from the playlist. Hence we need to schedule loading the next playlist even if the playlist is not a primary playlist.

Issue: #5011
PiperOrigin-RevId: 344995891
parent c7e1d3f2
...@@ -716,10 +716,13 @@ public final class DefaultHlsPlaylistTracker ...@@ -716,10 +716,13 @@ public final class DefaultHlsPlaylistTracker
: (playlistSnapshot.targetDurationUs / 2); : (playlistSnapshot.targetDurationUs / 2);
} }
earliestNextLoadTimeMs = currentTimeMs + C.usToMs(durationUntilNextLoadUs); earliestNextLoadTimeMs = currentTimeMs + C.usToMs(durationUntilNextLoadUs);
// Schedule a load if this is the primary playlist and it doesn't have an end tag. Else the // Schedule a load if this is the primary playlist or a playlist of a low-latency stream and
// next load will be scheduled when refreshPlaylist is called, or when this playlist becomes // it doesn't have an end tag. Else the next load will be scheduled when refreshPlaylist is
// the primary. // called, or when this playlist becomes the primary.
if (playlistUrl.equals(primaryMediaPlaylistUrl) && !playlistSnapshot.hasEndTag) { boolean scheduleLoad =
playlistSnapshot.partTargetDurationUs != C.TIME_UNSET
|| playlistUrl.equals(primaryMediaPlaylistUrl);
if (scheduleLoad && !playlistSnapshot.hasEndTag) {
loadPlaylistInternal(getMediaPlaylistUriForReload()); loadPlaylistInternal(getMediaPlaylistUriForReload());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment