Commit 8b4fca52 authored by Simon Morlat's avatar Simon Morlat

fix c++ android sound initialization for blacklisted devices

parent 25065207
......@@ -251,6 +251,13 @@ static void android_snd_card_detect(MSSndCardManager *m) {
return;
}
devices = ms_factory_get_devices_info(m->factory);
d = ms_devices_info_get_sound_device_description(devices);
if (d->flags & DEVICE_HAS_UNSTANDARD_LIBMEDIA){
ms_message("Native android sound support is blacklisted for this device.");
return;
}
/* libmedia and libutils static variable may survive to Linphone restarts
It is then necessary to perform the *::init() calls even if the libmedia and libutils are there.*/
if (!libmedia) libmedia=Library::load("/system/lib/libmedia.so");
......@@ -265,10 +272,9 @@ static void android_snd_card_detect(MSSndCardManager *m) {
audio_system_loaded = AudioSystemImpl::init(libmedia);
}
devices = ms_factory_get_devices_info(m->factory);
d = ms_devices_info_get_sound_device_description(devices);
if (audio_record_loaded && audio_track_loaded && audio_system_loaded && string8_loaded && refbase_loaded && !(d->flags & DEVICE_HAS_UNSTANDARD_LIBMEDIA)) {
if (audio_record_loaded && audio_track_loaded && audio_system_loaded && string8_loaded && refbase_loaded) {
ms_message("Native android sound support available.");
MSSndCard* card = android_snd_card_new(d);
ms_snd_card_set_manager(m, card);
......
......@@ -65,7 +65,7 @@ static SoundDeviceDescription devices[]={
{ "motorola", "XT907", "", 0, 500 },
{ "motorola", "DROIX X2", "", 0, 320 },
{ "motorola", "MotoG3", "msm8916", DEVICE_HAS_BUILTIN_AEC_CRAPPY, 100 }, /*The MotoG3 audio capture hangs for several seconds when switching to speaker mode*/
{ "motorola", "Nexus 6", "msm8084", DEVICE_HAS_BUILTIN_OPENSLES_AEC, 0}, /* Nexus 6*/
{ "motorola", "Nexus 6", "msm8084", DEVICE_HAS_BUILTIN_OPENSLES_AEC, 0}, /* Nexus 6*/
{ "samsung", "GT-S5360", "bcm21553", 0, 250 }, /*<Galaxy Y*/
{ "samsung", "GT-S5360L", "", 0, 250 }, /*<Galaxy Y*/
{ "samsung", "GT-S6102", "", DEVICE_HAS_BUILTIN_AEC, 0 }, /*<Galaxy Y duo*/
......@@ -148,10 +148,10 @@ static SoundDeviceDescription devices[]={
{ "LENOVO", "Lenovo S60-a", "msm8916", 0, 0 , 44100},
{ "blackberry", "STV100-4", "msm8992", DEVICE_HAS_BUILTIN_AEC | DEVICE_HAS_BUILTIN_OPENSLES_AEC, 0 , 48000},
{ "vodafone", "985N", "", DEVICE_HAS_UNSTANDARD_LIBMEDIA, 0 },
{ "Vodafone", "Vodafone 985N", "", DEVICE_HAS_UNSTANDARD_LIBMEDIA, 0 },
{ "HUAWEI", "P7-L10", "", DEVICE_HAS_UNSTANDARD_LIBMEDIA, 0 },
{ "HUAWEI", "P7-L11", "", DEVICE_HAS_UNSTANDARD_LIBMEDIA, 0 },
{ "HUAWEI", "HUAWEI P7-L10", "", DEVICE_HAS_UNSTANDARD_LIBMEDIA, 0 },
{ "HUAWEI", "HUAWEI P7-L11", "", DEVICE_HAS_UNSTANDARD_LIBMEDIA, 0 },
{ NULL, NULL, NULL, 0, 0, 0}
};
......
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