Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move playback speed update at period transitions to reading period.
In some cases we need to update the PlaybackParameters at period boundaries, for example when switching from live to VOD and live playback speed adjustment was still active at the point of switching. Currently, we send the update when the playing MediaPeriod changes in EPII, which is slightly too late because the new speed gets only applied after the entire existing AudioTrack buffer has been played out. We can time the update slightly better by updating the values at the point where we change the reading period. This makes the update slightly too early because it also applies to all samples currently in the decoder. But generally, this is a lot better because the time spent in the decoder is likely to be considerably lower than the duration of the AudioTrack buffer. Note that this change isn't perfectly aligning to the period boundary, but reduces the number of samples with the wrong speed to a minimum. If we are getting around to add additional code that allows updating the speed at exactly the boundary, it also needs to be triggered from the reading period update, so the new code location is also helpful in the future. Issue: #9018 PiperOrigin-RevId: 424540551
- Loading branch information