Merge "Optimize HW_AV_SYNC playback by avoiding multiple timestamp block allocations." into oc-dev
am: e0e55f535a
Change-Id: I8fb4d8f1a1d237aa28780f6f419b9a8fd6131a06
This commit is contained in:
@@ -2523,8 +2523,11 @@ public class AudioTrack extends PlayerBase
|
|||||||
mAvSyncHeader = ByteBuffer.allocate(16);
|
mAvSyncHeader = ByteBuffer.allocate(16);
|
||||||
mAvSyncHeader.order(ByteOrder.BIG_ENDIAN);
|
mAvSyncHeader.order(ByteOrder.BIG_ENDIAN);
|
||||||
mAvSyncHeader.putInt(0x55550001);
|
mAvSyncHeader.putInt(0x55550001);
|
||||||
mAvSyncHeader.putInt(sizeInBytes);
|
}
|
||||||
mAvSyncHeader.putLong(timestamp);
|
|
||||||
|
if (mAvSyncBytesRemaining == 0) {
|
||||||
|
mAvSyncHeader.putInt(4, sizeInBytes);
|
||||||
|
mAvSyncHeader.putLong(8, timestamp);
|
||||||
mAvSyncHeader.position(0);
|
mAvSyncHeader.position(0);
|
||||||
mAvSyncBytesRemaining = sizeInBytes;
|
mAvSyncBytesRemaining = sizeInBytes;
|
||||||
}
|
}
|
||||||
@@ -2556,9 +2559,6 @@ public class AudioTrack extends PlayerBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
mAvSyncBytesRemaining -= ret;
|
mAvSyncBytesRemaining -= ret;
|
||||||
if (mAvSyncBytesRemaining == 0) {
|
|
||||||
mAvSyncHeader = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user