mirror of
https://github.com/androidx/media.git
synced 2025-05-07 23:50:44 +08:00
Let AudioTrack write headers on SDK_INT >= 26
Issue: #6031 PiperOrigin-RevId: 253784986
This commit is contained in:
parent
d072a5261e
commit
def01f68b9
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user