Merge pull request #1651 from colinkho:mp-cl
PiperOrigin-RevId: 683548885
This commit is contained in:
commit
62864d5475
@ -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,10 +2651,13 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
private void maybeContinueLoading() {
|
private void maybeContinueLoading() {
|
||||||
shouldContinueLoading = shouldContinueLoading();
|
shouldContinueLoading = shouldContinueLoading();
|
||||||
if (shouldContinueLoading) {
|
if (shouldContinueLoading) {
|
||||||
queue
|
MediaPeriodHolder loadingPeriod = checkNotNull(queue.getLoadingPeriod());
|
||||||
.getLoadingPeriod()
|
loadingPeriod.continueLoading(
|
||||||
.continueLoading(
|
new LoadingInfo.Builder()
|
||||||
rendererPositionUs, mediaClock.getPlaybackParameters().speed, lastRebufferRealtimeMs);
|
.setPlaybackPositionUs(loadingPeriod.toPeriodTime(rendererPositionUs))
|
||||||
|
.setPlaybackSpeed(mediaClock.getPlaybackParameters().speed)
|
||||||
|
.setLastRebufferRealtimeMs(lastRebufferRealtimeMs)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
updateIsLoading();
|
updateIsLoading();
|
||||||
}
|
}
|
||||||
|
@ -235,25 +235,15 @@ 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 rendererPositionUs The load position in renderer time, in microseconds.
|
* @param loadingInfo The {@link LoadingInfo} about the current player state relevant to this load
|
||||||
* @param playbackSpeed The playback speed indicating the current rate of playback.
|
* request.
|
||||||
* @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