Add LoadingInfo as a parameter to continueLoading on MediaPeriodHolder
This commit is contained in:
parent
8d0b82dfc3
commit
7b0f83690c
@ -2647,10 +2647,14 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
private void maybeContinueLoading() {
|
private void maybeContinueLoading() {
|
||||||
shouldContinueLoading = shouldContinueLoading();
|
shouldContinueLoading = shouldContinueLoading();
|
||||||
if (shouldContinueLoading) {
|
if (shouldContinueLoading) {
|
||||||
|
LoadingInfo loadingInfo = new LoadingInfo.Builder()
|
||||||
|
.setPlaybackPositionUs(queue.getLoadingPeriod().toPeriodTime(rendererPositionUs))
|
||||||
|
.setPlaybackSpeed(mediaClock.getPlaybackParameters().speed)
|
||||||
|
.setLastRebufferRealtimeMs(lastRebufferRealtimeMs)
|
||||||
|
.build();
|
||||||
queue
|
queue
|
||||||
.getLoadingPeriod()
|
.getLoadingPeriod()
|
||||||
.continueLoading(
|
.continueLoading(loadingInfo);
|
||||||
rendererPositionUs, mediaClock.getPlaybackParameters().speed, lastRebufferRealtimeMs);
|
|
||||||
}
|
}
|
||||||
updateIsLoading();
|
updateIsLoading();
|
||||||
}
|
}
|
||||||
|
@ -238,22 +238,11 @@ import java.io.IOException;
|
|||||||
* Continues loading the media period at the given renderer position. Should only be called if
|
* Continues loading the media period at the given renderer position. Should only be called if
|
||||||
* this is the loading media period.
|
* this is the loading media period.
|
||||||
*
|
*
|
||||||
* @param rendererPositionUs The load position in renderer time, in microseconds.
|
* @param loadingInfo The {@link LoadingInfo} when attempting to continue loading.
|
||||||
* @param playbackSpeed The playback speed indicating the current rate of playback.
|
|
||||||
* @param lastRebufferRealtimeMs The time at which the last rebuffering occurred, in milliseconds
|
|
||||||
* since boot including time spent in sleep. The time base used is the same as that measured
|
|
||||||
* by {@link android.os.SystemClock#elapsedRealtime}.
|
|
||||||
*/
|
*/
|
||||||
public void continueLoading(
|
public void continueLoading(LoadingInfo loadingInfo) {
|
||||||
long rendererPositionUs, float playbackSpeed, long lastRebufferRealtimeMs) {
|
|
||||||
checkState(isLoadingMediaPeriod());
|
checkState(isLoadingMediaPeriod());
|
||||||
long loadingPeriodPositionUs = toPeriodTime(rendererPositionUs);
|
mediaPeriod.continueLoading(loadingInfo);
|
||||||
mediaPeriod.continueLoading(
|
|
||||||
new LoadingInfo.Builder()
|
|
||||||
.setPlaybackPositionUs(loadingPeriodPositionUs)
|
|
||||||
.setPlaybackSpeed(playbackSpeed)
|
|
||||||
.setLastRebufferRealtimeMs(lastRebufferRealtimeMs)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user