mirror of
https://github.com/samsonjs/media.git
synced 2026-03-25 09:25:53 +00:00
Disable offload scheduling at set up for track transition
While sleeping for offload, position is estimated based on time playing. If asleep and AudioTrack is reused, then the position will keep incrementing as the subsequent item plays. That is until wakeup when playing position is updated to the timestamp of the second item. Offload scheduling should be disabled until track transitions fully. PiperOrigin-RevId: 570397140
This commit is contained in:
parent
bd5a3920b8
commit
da06bf057a
1 changed files with 5 additions and 0 deletions
|
|
@ -2251,6 +2251,11 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
readingPeriodHolder.getStartPositionRendererTime(),
|
||||
readingPeriodHolder.getRendererOffset(),
|
||||
readingPeriodHolder.info.id);
|
||||
if (offloadSchedulingEnabled) {
|
||||
// Prevent sleeping across offload track transition else position won't get updated.
|
||||
// TODO: (b/183635183) Optimize Offload End-Of-Stream: Sleep to just before end of track
|
||||
setOffloadSchedulingEnabled(false);
|
||||
}
|
||||
} else if (renderer.isEnded()) {
|
||||
// The renderer has finished playback, so we can disable it now.
|
||||
disableRenderer(renderer);
|
||||
|
|
|
|||
Loading…
Reference in a new issue