Remove pointless use of playbackInfo.startPositionUs

We have a flag that gets turned on if the current playback position has been
reset, so that messages from this reset position can be triggered. This
mechanism isn't actually depending on the startPositionUs field because it
should always be triggered in the first iteration with the new position.

PiperOrigin-RevId: 290749201
This commit is contained in:
tonihei 2020-01-21 16:34:24 +00:00 committed by Ian Baker
parent 5f9a585075
commit 2564a121dc

View file

@ -1318,13 +1318,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
if (pendingMessages.isEmpty() || playbackInfo.periodId.isAd()) {
return;
}
// If this is the first call from the start position, include oldPeriodPositionUs in potential
// trigger positions, but make sure we deliver it only once.
if (playbackInfo.startPositionUs == oldPeriodPositionUs
&& deliverPendingMessageAtStartPositionRequired) {
// If this is the first call after resetting the renderer position, include oldPeriodPositionUs
// in potential trigger positions, but make sure we deliver it only once.
if (deliverPendingMessageAtStartPositionRequired) {
oldPeriodPositionUs--;
deliverPendingMessageAtStartPositionRequired = false;
}
deliverPendingMessageAtStartPositionRequired = false;
// Correct next index if necessary (e.g. after seeking, timeline changes, or new messages)
int currentPeriodIndex =