summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-03-05 17:06:40 -0800
committerEric Laurent <elaurent@google.com>2012-03-05 17:18:36 -0800
commitd8d6185c978c9b27ca69e7791785e0983ed9e8b8 (patch)
treecda49b71e787cf1bcf68671e237389f70706cff3 /media
parent985ed9a1a22ec7e6e245d3fb8e93d3a23bdc539b (diff)
downloadframeworks_av-d8d6185c978c9b27ca69e7791785e0983ed9e8b8.zip
frameworks_av-d8d6185c978c9b27ca69e7791785e0983ed9e8b8.tar.gz
frameworks_av-d8d6185c978c9b27ca69e7791785e0983ed9e8b8.tar.bz2
AudioTrack: relax check on minimum buffer size
Current AudioTrack implementation enforces that the requested audio buffer size is at least corresponding the audio latency. This requirement is too strong and leads to problems with current stagefright and AudioSink implementations when playing over output streams with long latency. Ultimately, the AudioSink design should be changed to specify a minimum buffer size in time or frames units but not in buffer count units. Change-Id: I8ba603956f92ac49143a8249572665aa548f2f0f
Diffstat (limited to 'media')
-rw-r--r--media/libmedia/AudioTrack.cpp9
1 files changed, 3 insertions, 6 deletions
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