mirror of
https://github.com/androidx/media.git
synced 2025-05-04 14:10:40 +08:00
Fix incorrect renderer reset enable position
handlePeriodPrepared ->setPlayingPeriodHolder ->enableRenderers passes rendererPositionUs to renderer.enable(), but this value is not set correctly. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=138176114
This commit is contained in:
parent
e2081f40fb
commit
3e2cb9f89a
@ -1069,12 +1069,12 @@ import java.io.IOException;
|
|||||||
if (playingPeriodHolder == null) {
|
if (playingPeriodHolder == null) {
|
||||||
// This is the first prepared period, so start playing it.
|
// This is the first prepared period, so start playing it.
|
||||||
readingPeriodHolder = loadingPeriodHolder;
|
readingPeriodHolder = loadingPeriodHolder;
|
||||||
|
resetRendererPosition(readingPeriodHolder.startPositionUs);
|
||||||
setPlayingPeriodHolder(readingPeriodHolder);
|
setPlayingPeriodHolder(readingPeriodHolder);
|
||||||
if (playbackInfo.startPositionUs == C.TIME_UNSET) {
|
if (playbackInfo.startPositionUs == C.TIME_UNSET) {
|
||||||
// Update the playback info when seeking to a default position.
|
// Update the playback info when seeking to a default position.
|
||||||
playbackInfo = new PlaybackInfo(playingPeriodHolder.index,
|
playbackInfo = new PlaybackInfo(playingPeriodHolder.index,
|
||||||
playingPeriodHolder.startPositionUs);
|
playingPeriodHolder.startPositionUs);
|
||||||
resetRendererPosition(playbackInfo.startPositionUs);
|
|
||||||
updatePlaybackPositions();
|
updatePlaybackPositions();
|
||||||
eventHandler.obtainMessage(MSG_POSITION_DISCONTINUITY, playbackInfo).sendToTarget();
|
eventHandler.obtainMessage(MSG_POSITION_DISCONTINUITY, playbackInfo).sendToTarget();
|
||||||
}
|
}
|
||||||
@ -1116,8 +1116,7 @@ import java.io.IOException;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPlayingPeriodHolder(MediaPeriodHolder periodHolder)
|
private void setPlayingPeriodHolder(MediaPeriodHolder periodHolder) throws ExoPlaybackException {
|
||||||
throws ExoPlaybackException {
|
|
||||||
int enabledRendererCount = 0;
|
int enabledRendererCount = 0;
|
||||||
boolean[] rendererWasEnabledFlags = new boolean[renderers.length];
|
boolean[] rendererWasEnabledFlags = new boolean[renderers.length];
|
||||||
for (int i = 0; i < renderers.length; i++) {
|
for (int i = 0; i < renderers.length; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user