Commit 8dc81040 by andrewlewis Committed by Oliver Woodman

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
parent 45c68a2f
...@@ -1068,8 +1068,9 @@ import java.io.IOException; ...@@ -1068,8 +1068,9 @@ import java.io.IOException;
} }
if (loadingPeriodHolder == null if (loadingPeriodHolder == null
|| (loadingPeriodHolder.isFullyBuffered() && !loadingPeriodHolder.isLast || (loadingPeriodHolder.isFullyBuffered()
&& (playingPeriodHolder == null && timeline.getPeriod(loadingPeriodHolder.index, period).getDurationUs() != C.TIME_UNSET
&& !loadingPeriodHolder.isLast && (playingPeriodHolder == null
|| loadingPeriodHolder.index - playingPeriodHolder.index < MAXIMUM_BUFFER_AHEAD_PERIODS))) { || 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. // 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 int newLoadingPeriodIndex = loadingPeriodHolder == null ? playbackInfo.periodIndex
......
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