Clean up frame size in AudioTrack and AudioFlinger
TrackBase::mFrameSize, mChannelMask, and mChannelCount are now const.
Use TrackBase::mFrameSize instead of re-calculating frame size.
AudioFlinger only sees 16-bit PCM format, conversion from 8-bit is
now entirely on the client side. Previously a small part of the
responsibility was on server side also.
size_t is unsigned, so use %u in logs.
Fix theoretical bug where TrackBase constructor was over-allocating space
for non-linear AudioTrack or 8-bit PCM AudioRecord (probably benign).
Change-Id: I7cbbba0bf4dba29ea751d8af341ab8e5cbbdc206
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index 99d583d..6fd1b9e 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -520,7 +520,7 @@
// address space. AudioFlinger::TrackBase::mBuffer is for the server address space.
void* mBuffers;
- audio_format_t mFormat;
+ audio_format_t mFormat; // as requested by client, not forced to 16-bit
audio_stream_type_t mStreamType;
uint8_t mChannelCount;
uint8_t mMuted;