Loading media/libmedia/AudioTrack.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -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; Loading voip/jni/rtp/AudioGroup.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading Loading
media/libmedia/AudioTrack.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -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; Loading
voip/jni/rtp/AudioGroup.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading