mirror of
https://github.com/samsonjs/media.git
synced 2026-04-04 11:05:47 +00:00
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:
parent
5f9a585075
commit
2564a121dc
1 changed files with 4 additions and 5 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Reference in a new issue