mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

When a passthrough AudioTrack is replaced (due to seeking) the new one behaves as if it is still emptying data from the old one, with its playback position advancing until it runs out of data. Data written while the 'old' AudioTrack was emptying would be discarded, so avoid writing to the new AudioTrack while the old one is still emptying. Also avoid using AudioTrack.getTimestamp with passthrough tracks, as this causes the playback position to jump to a position that breaks audio/video synchronization.