Commit 8a99057d authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Fixed needsEchoCalibration JNI method

parent 472befa7
......@@ -2388,25 +2388,16 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_startEchoCalibration(JNI
}
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_needsEchoCalibration(JNIEnv *env, jobject thiz, jlong lcptr) {
MSSndCard *sndcard;
LinphoneCore *lc = (LinphoneCore*) lcptr;
MSFactory * factory = linphone_core_get_ms_factory(lc);
MSSndCardManager *m = ms_factory_get_snd_card_manager(factory);
const char *card = linphone_core_get_capture_device((LinphoneCore*)lc);
sndcard = ms_snd_card_manager_get_card(m, card);
if (sndcard == NULL) {
ms_error("Could not get soundcard %s", card);
return TRUE;
}
MSDevicesInfo *devices = ms_factory_get_devices_info(factory);
SoundDeviceDescription *sound_description = ms_devices_info_get_sound_device_description(devices);
if(sound_description != NULL && sound_description == &genericSoundDeviceDescriptor){
return TRUE;
}
if (ms_snd_card_get_capabilities(sndcard) & MS_SND_CARD_CAP_BUILTIN_ECHO_CANCELLER) return FALSE;
if (ms_snd_card_get_minimal_latency(sndcard) != 0) return FALSE;
if (sound_description->flags & DEVICE_HAS_BUILTIN_AEC) return FALSE;
if (sound_description->delay != 0) return FALSE;
return TRUE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment