mirror of
https://github.com/samsonjs/media.git
synced 2026-04-02 10:45:51 +00:00
Load the next period only if its start point is known.
If a period has no enabled tracks it is considered to be fully buffered, even if its duration is unknown. This would cause the offset of the next loading period to be set based on the unset duration of the preceding period, in turn causing the from of the player to expose a position based on an unset value. Only load the next period when the current one has a known duration. If a period has no enabled tracks and an unknown duration this causes the player to play the period indefinitely. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=140613858
This commit is contained in:
parent
45c68a2fd5
commit
8dc8104059
1 changed files with 3 additions and 2 deletions
|
|
@ -1068,8 +1068,9 @@ import java.io.IOException;
|
|||
}
|
||||
|
||||
if (loadingPeriodHolder == null
|
||||
|| (loadingPeriodHolder.isFullyBuffered() && !loadingPeriodHolder.isLast
|
||||
&& (playingPeriodHolder == null
|
||||
|| (loadingPeriodHolder.isFullyBuffered()
|
||||
&& timeline.getPeriod(loadingPeriodHolder.index, period).getDurationUs() != C.TIME_UNSET
|
||||
&& !loadingPeriodHolder.isLast && (playingPeriodHolder == null
|
||||
|| loadingPeriodHolder.index - playingPeriodHolder.index < MAXIMUM_BUFFER_AHEAD_PERIODS))) {
|
||||
// We don't have a loading period or it's fully loaded, so try and create the next one.
|
||||
int newLoadingPeriodIndex = loadingPeriodHolder == null ? playbackInfo.periodIndex
|
||||
|
|
|
|||
Loading…
Reference in a new issue