Let AudioTrack write headers on SDK_INT >= 26

Issue: #6031
PiperOrigin-RevId: 253784986
This commit is contained in:
olly 2019-06-18 15:24:53 +01:00 committed by Oliver Woodman
parent d072a5261e
commit def01f68b9

View File

@ -1178,11 +1178,10 @@ public final class DefaultAudioSink implements AudioSink {
@TargetApi(21)
private int writeNonBlockingWithAvSyncV21(AudioTrack audioTrack, ByteBuffer buffer, int size,
long presentationTimeUs) {
// TODO: Uncomment this when [Internal ref: b/33627517] is clarified or fixed.
// if (Util.SDK_INT >= 23) {
// // The underlying platform AudioTrack writes AV sync headers directly.
// return audioTrack.write(buffer, size, WRITE_NON_BLOCKING, presentationTimeUs * 1000);
// }
if (Util.SDK_INT >= 26) {
// The underlying platform AudioTrack writes AV sync headers directly.
return audioTrack.write(buffer, size, WRITE_NON_BLOCKING, presentationTimeUs * 1000);
}
if (avSyncHeader == null) {
avSyncHeader = ByteBuffer.allocate(16);
avSyncHeader.order(ByteOrder.BIG_ENDIAN);