Commit def01f68 by olly Committed by Oliver Woodman

Let AudioTrack write headers on SDK_INT >= 26

Issue: #6031
PiperOrigin-RevId: 253784986
parent d072a526
...@@ -1178,11 +1178,10 @@ public final class DefaultAudioSink implements AudioSink { ...@@ -1178,11 +1178,10 @@ public final class DefaultAudioSink implements AudioSink {
@TargetApi(21) @TargetApi(21)
private int writeNonBlockingWithAvSyncV21(AudioTrack audioTrack, ByteBuffer buffer, int size, private int writeNonBlockingWithAvSyncV21(AudioTrack audioTrack, ByteBuffer buffer, int size,
long presentationTimeUs) { long presentationTimeUs) {
// TODO: Uncomment this when [Internal ref: b/33627517] is clarified or fixed. if (Util.SDK_INT >= 26) {
// if (Util.SDK_INT >= 23) { // The underlying platform AudioTrack writes AV sync headers directly.
// // The underlying platform AudioTrack writes AV sync headers directly. return audioTrack.write(buffer, size, WRITE_NON_BLOCKING, presentationTimeUs * 1000);
// return audioTrack.write(buffer, size, WRITE_NON_BLOCKING, presentationTimeUs * 1000); }
// }
if (avSyncHeader == null) { if (avSyncHeader == null) {
avSyncHeader = ByteBuffer.allocate(16); avSyncHeader = ByteBuffer.allocate(16);
avSyncHeader.order(ByteOrder.BIG_ENDIAN); avSyncHeader.order(ByteOrder.BIG_ENDIAN);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment