Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle AV sync timestamps when draining the audio sink during tunneling
When audio processors are enabled during tunneling, they must produce output immediately, ensuring that the timestamps of the output samples correspond to the input and that no additional samples are produced. This requirement is documented in the Javadoc of DefaultAudioSink. However, this alone doesn't guarantee all buffers are immediately written to the AudioTrack, because the AudioTrack writes are non-blocking and may need multiple attempts. When draining the audio sink at the end of the stream, we currently fail in this situation because we assert that the timestamp must be set (=the drain operation is a no-op). But this may not be true when the previous non-blocking write wasn't fully handled. We can fix this by saving the last timestamp and reusing it during draining. Issue: #10847 PiperOrigin-RevId: 500943891
- Loading branch information