diff options
| author | 2012-03-16 15:01:01 -0700 | |
|---|---|---|
| committer | 2012-03-16 15:01:01 -0700 | |
| commit | 393dd03eafa8c2d6b7ddda9ceee72df5c9a6abdb (patch) | |
| tree | 4a9a82c6c9c7bc72f8fee9477c5c8ef094d70c8e | |
| parent | 31f7ef2436ca7cbe754f33d536593f9640a31fb0 (diff) | |
| parent | 3fe7ee651db0aae9485ead227c89db1e24b9e245 (diff) | |
am 3fe7ee65: Merge "AudioTrack: relax check on minimum buffer size" into ics-mr1
* commit '3fe7ee651db0aae9485ead227c89db1e24b9e245':
AudioTrack: relax check on minimum buffer size
| -rw-r--r-- | include/media/AudioTrack.h | 6 | ||||
| -rw-r--r-- | media/libmedia/AudioTrack.cpp | 9 |
2 files changed, 7 insertions, 8 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index d1a8105612bb..1c401e2b276b 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -130,8 +130,10 @@ public: * format: Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed * 16 bits per sample). * channelMask: Channel mask: see audio_channels_t. - * frameCount: Total size of track PCM buffer in frames. This defines the - * latency of the track. + * frameCount: Minimum size of track PCM buffer in frames. This defines the + * latency of the track. The actual size selected by the AudioTrack could be + * larger if the requested size is not compatible with current audio HAL + * latency. * flags: Reserved for future use. * cbf: Callback function. If not null, this function is called periodically * to request new PCM data. diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 8ebb6521382b..498ad454bb7f 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -763,12 +763,9 @@ status_t AudioTrack::createTrack_l( mNotificationFramesAct = frameCount/2; } if (frameCount < minFrameCount) { - if (enforceFrameCount) { - LOGE("Invalid buffer size: minFrameCount %d, frameCount %d", minFrameCount, frameCount); - return BAD_VALUE; - } else { - frameCount = minFrameCount; - } + LOGW_IF(enforceFrameCount, "Minimum buffer size corrected from %d to %d", + frameCount, minFrameCount); + frameCount = minFrameCount; } } else { // Ensure that buffer alignment matches channelcount |