mirror of
https://github.com/androidx/media.git
synced 2025-05-07 23:50:44 +08:00
Fix search to end of stream in HLS
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=139905590
This commit is contained in:
parent
77715fbfbe
commit
9ac7f64c84
@ -215,7 +215,7 @@ import java.util.Locale;
|
|||||||
int chunkMediaSequence;
|
int chunkMediaSequence;
|
||||||
if (previous == null || switchingVariant) {
|
if (previous == null || switchingVariant) {
|
||||||
long targetPositionUs = previous == null ? playbackPositionUs : previous.startTimeUs;
|
long targetPositionUs = previous == null ? playbackPositionUs : previous.startTimeUs;
|
||||||
if (targetPositionUs > mediaPlaylist.getEndTimeUs()) {
|
if (!mediaPlaylist.hasEndTag && targetPositionUs > mediaPlaylist.getEndTimeUs()) {
|
||||||
// If the playlist is too old to contain the chunk, we need to refresh it.
|
// If the playlist is too old to contain the chunk, we need to refresh it.
|
||||||
chunkMediaSequence = mediaPlaylist.mediaSequence + mediaPlaylist.segments.size();
|
chunkMediaSequence = mediaPlaylist.mediaSequence + mediaPlaylist.segments.size();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user