summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-08-02 09:02:07 -0700
committerGlenn Kasten <gkasten@google.com>2013-08-02 16:21:36 -0700
commit954315a10089fa3684ac94db5be77c6655c08fc0 (patch)
tree5258b8e752cce01d1009990cd549a3297570dbab /media
parentf36dbfe3d517e9311be0a4d0fd6658380690e84c (diff)
downloadframeworks_av-954315a10089fa3684ac94db5be77c6655c08fc0.zip
frameworks_av-954315a10089fa3684ac94db5be77c6655c08fc0.tar.gz
frameworks_av-954315a10089fa3684ac94db5be77c6655c08fc0.tar.bz2
Recording of non-linear formats is not supported
Such formats are already rejected in AudioRecord::set() Change-Id: I5ba1fd9e4cd659e5226c75aa4f63e52f655e0521
Diffstat (limited to 'media')
-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();