Formatting and additional call for preloading period
This commit is contained in:
parent
7b0f83690c
commit
bf88128383
@ -2380,7 +2380,11 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
preloading.prepare(/* callback= */ this, preloading.info.startPositionUs);
|
preloading.prepare(/* callback= */ this, preloading.info.startPositionUs);
|
||||||
} else {
|
} else {
|
||||||
preloading.continueLoading(
|
preloading.continueLoading(
|
||||||
rendererPositionUs, playbackInfo.playbackParameters.speed, lastRebufferRealtimeMs);
|
new LoadingInfo.Builder()
|
||||||
|
.setPlaybackPositionUs(preloading.toPeriodTime(rendererPositionUs))
|
||||||
|
.setPlaybackSpeed(mediaClock.getPlaybackParameters().speed)
|
||||||
|
.setLastRebufferRealtimeMs(lastRebufferRealtimeMs)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2647,14 +2651,13 @@ 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()
|
MediaPeriodHolder loadingPeriod = checkNotNull(queue.getLoadingPeriod());
|
||||||
.setPlaybackPositionUs(queue.getLoadingPeriod().toPeriodTime(rendererPositionUs))
|
loadingPeriod.continueLoading(
|
||||||
|
new LoadingInfo.Builder()
|
||||||
|
.setPlaybackPositionUs(loadingPeriod.toPeriodTime(rendererPositionUs))
|
||||||
.setPlaybackSpeed(mediaClock.getPlaybackParameters().speed)
|
.setPlaybackSpeed(mediaClock.getPlaybackParameters().speed)
|
||||||
.setLastRebufferRealtimeMs(lastRebufferRealtimeMs)
|
.setLastRebufferRealtimeMs(lastRebufferRealtimeMs)
|
||||||
.build();
|
.build());
|
||||||
queue
|
|
||||||
.getLoadingPeriod()
|
|
||||||
.continueLoading(loadingInfo);
|
|
||||||
}
|
}
|
||||||
updateIsLoading();
|
updateIsLoading();
|
||||||
}
|
}
|
||||||
|
@ -235,10 +235,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 with the given {@link LoadingInfo}. Should only be called if
|
||||||
* this is the loading media period.
|
* this is the loading media period.
|
||||||
*
|
*
|
||||||
* @param loadingInfo The {@link LoadingInfo} when attempting to continue loading.
|
* @param loadingInfo The {@link LoadingInfo} about the current player state relevant to this load
|
||||||
|
* request.
|
||||||
*/
|
*/
|
||||||
public void continueLoading(LoadingInfo loadingInfo) {
|
public void continueLoading(LoadingInfo loadingInfo) {
|
||||||
checkState(isLoadingMediaPeriod());
|
checkState(isLoadingMediaPeriod());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user