summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-08-05 14:22:12 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-08-05 14:22:12 +0000
commitfd87902a26f1a954643a5d0b414bd31a3cf61e0a (patch)
treee2b9508b0b2451b00244284a33aabc007132a781
parent101334a6d7ae466a4535a31aec281625198ea88f (diff)
parent954315a10089fa3684ac94db5be77c6655c08fc0 (diff)
downloadframeworks_av-fd87902a26f1a954643a5d0b414bd31a3cf61e0a.zip
frameworks_av-fd87902a26f1a954643a5d0b414bd31a3cf61e0a.tar.gz
frameworks_av-fd87902a26f1a954643a5d0b414bd31a3cf61e0a.tar.bz2
Merge "Recording of non-linear formats is not supported"
-rw-r--r--media/libmedia/AudioRecord.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 0e7e17f..103a5f1 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -60,10 +60,9 @@ status_t AudioRecord::getMinFrameCount(
// We double the size of input buffer for ping pong use of record buffer.
size <<= 1;
- if (audio_is_linear_pcm(format)) {
- uint32_t channelCount = popcount(channelMask);
- size /= channelCount * audio_bytes_per_sample(format);
- }
+ // Assumes audio_is_linear_pcm(format)
+ uint32_t channelCount = popcount(channelMask);
+ size /= channelCount * audio_bytes_per_sample(format);
*frameCount = size;
return NO_ERROR;
@@ -205,11 +204,8 @@ status_t AudioRecord::set(
uint32_t channelCount = popcount(channelMask);
mChannelCount = channelCount;
- if (audio_is_linear_pcm(format)) {
- mFrameSize = channelCount * audio_bytes_per_sample(format);
- } else {
- mFrameSize = sizeof(uint8_t);
- }
+ // Assumes audio_is_linear_pcm(format), else sizeof(uint8_t)
+ mFrameSize = channelCount * audio_bytes_per_sample(format);
if (sessionId == 0 ) {
mSessionId = AudioSystem::newAudioSessionId();