summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--media/libmedia/AudioTrack.cpp12
-rw-r--r--voip/jni/rtp/AudioGroup.cpp9
2 files changed, 20 insertions, 1 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 3f3bcd3..a9ab982 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -54,6 +54,18 @@ status_t AudioTrack::getMinFrameCount(
int streamType,
uint32_t sampleRate)
{
+#ifdef QCOM_HARDWARE
+ if(streamType == AUDIO_STREAM_VOICE_CALL) {
+ LOGV("AudioTrack :: getMinFramecount voice call \n");
+ if(sampleRate == 8000) {
+ *frameCount = 160;
+ } else if (sampleRate == 16000) {
+ *frameCount = 320;
+ }
+ return NO_ERROR;
+ }
+#endif
+
int afSampleRate;
if (AudioSystem::getOutputSamplingRate(&afSampleRate, streamType) != NO_ERROR) {
return NO_INIT;
diff --git a/voip/jni/rtp/AudioGroup.cpp b/voip/jni/rtp/AudioGroup.cpp
index 459756d..bd8c1c4 100644
--- a/voip/jni/rtp/AudioGroup.cpp
+++ b/voip/jni/rtp/AudioGroup.cpp
@@ -870,8 +870,11 @@ bool AudioGroup::DeviceThread::threadLoop()
int16_t input[sampleCount];
int toWrite = sampleCount;
int toRead = (mode == MUTED) ? 0 : sampleCount;
+#ifdef QCOM_HARDWARE
+ int chances = 10000;
+#else
int chances = 100;
-
+#endif
while (--chances > 0 && (toWrite > 0 || toRead > 0)) {
if (toWrite > 0) {
AudioTrack::Buffer buffer;
@@ -985,7 +988,11 @@ void add(JNIEnv *env, jobject thiz, jint mode,
if (!group) {
int mode = env->GetIntField(thiz, gMode);
group = new AudioGroup;
+#ifdef QCOM_HARDWARE
+ if (!group->set(sampleRate, sampleCount) || !group->setMode(mode)) {
+#else
if (!group->set(8000, 256) || !group->setMode(mode)) {
+#endif
jniThrowException(env, "java/lang/IllegalStateException",
"cannot initialize audio group");
goto error;