diff options
author | Jean-Michel Trivi <> | 2009-03-24 22:42:57 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-24 22:42:57 -0700 |
commit | 6c349db7f21b6887a06a783c13b0a78dc5da6a66 (patch) | |
tree | e8c0cefefa60950a090e4195264a12ee3d332509 /core | |
parent | 4840e143df9804e3399a4e0341c0601f80d65d6e (diff) | |
download | frameworks_base-6c349db7f21b6887a06a783c13b0a78dc5da6a66.zip frameworks_base-6c349db7f21b6887a06a783c13b0a78dc5da6a66.tar.gz frameworks_base-6c349db7f21b6887a06a783c13b0a78dc5da6a66.tar.bz2 |
Automated import from //branches/master/...@142373,142373
Diffstat (limited to 'core')
-rw-r--r-- | core/jni/android_media_AudioTrack.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/jni/android_media_AudioTrack.cpp b/core/jni/android_media_AudioTrack.cpp index f625ffb..b8d6586 100644 --- a/core/jni/android_media_AudioTrack.cpp +++ b/core/jni/android_media_AudioTrack.cpp @@ -744,6 +744,7 @@ static jint android_media_AudioTrack_get_min_buff_size(JNIEnv *env, jobject thi // Ensure that buffer depth covers at least audio hardware latency uint32_t minBufCount = afLatency / ((1000 * afFrameCount)/afSamplingRate); + if (minBufCount < 2) minBufCount = 2; uint32_t minFrameCount = (afFrameCount*sampleRateInHertz*minBufCount)/afSamplingRate; int minBuffSize = minFrameCount * (audioFormat == javaAudioTrackFields.PCM16 ? 2 : 1) |