summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-03-06 10:52:18 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-06 10:52:18 -0800
commit22f9dd98d9c4c3e0e58586cf6a6008ca6ee946e5 (patch)
treefab85d9d97dadde1495cab326bae501b06fe6293
parent56617834920554fc68a818da17b56e0c2ad8f254 (diff)
parentd8d6185c978c9b27ca69e7791785e0983ed9e8b8 (diff)
downloadframeworks_av-22f9dd98d9c4c3e0e58586cf6a6008ca6ee946e5.zip
frameworks_av-22f9dd98d9c4c3e0e58586cf6a6008ca6ee946e5.tar.gz
frameworks_av-22f9dd98d9c4c3e0e58586cf6a6008ca6ee946e5.tar.bz2
Merge "AudioTrack: relax check on minimum buffer size"
-rw-r--r--include/media/AudioTrack.h6
-rw-r--r--media/libmedia/AudioTrack.cpp9
2 files changed, 7 insertions, 8 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index 9f2bd3a..95b9d86 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -135,8 +135,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 4890f05..a1c99e5 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -784,12 +784,9 @@ status_t AudioTrack::createTrack_l(
mNotificationFramesAct = frameCount/2;
}
if (frameCount < minFrameCount) {
- if (enforceFrameCount) {
- ALOGE("Invalid buffer size: minFrameCount %d, frameCount %d", minFrameCount, frameCount);
- return BAD_VALUE;
- } else {
- frameCount = minFrameCount;
- }
+ ALOGW_IF(enforceFrameCount, "Minimum buffer size corrected from %d to %d",
+ frameCount, minFrameCount);
+ frameCount = minFrameCount;
}
} else {
// Ensure that buffer alignment matches channelCount