Commit bb0d2409 authored by Simon Morlat's avatar Simon Morlat

Fix soundcard usage optimization for iOS: after a conference call the...

Fix soundcard usage optimization for iOS: after a conference call the AudioUnit wasn't released, which was causing next call to have no audio.
parent cda7797b
......@@ -685,9 +685,12 @@ void LocalConference::onCallTerminating (LinphoneCall *call) {
ms_message("conference_check_uninit(): size=%i", getSize());
if ((remote_count == 1) && !m_terminating)
convertConferenceToCall();
if (remote_count == 0) {
if (m_localParticipantStream)
if (m_localParticipantStream){
removeLocalEndpoint();
linphone_core_soundcard_hint_check(m_core);
}
if (m_recordEndpoint) {
ms_audio_conference_remove_member(m_conf, m_recordEndpoint);
ms_audio_endpoint_destroy(m_recordEndpoint);
......
......@@ -6225,6 +6225,7 @@ int linphone_core_get_calls_nb(const LinphoneCore *lc) {
return (int)L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getCallCount();
}
void linphone_core_soundcard_hint_check(LinphoneCore* lc) {
L_GET_CPP_PTR_FROM_C_OBJECT(lc)->soundcardHintCheck();
}
......
......@@ -27,6 +27,7 @@
// TODO: Remove me later.
#include "c-wrapper/c-wrapper.h"
#include "conference_private.h"
#include <mediastreamer2/msvolume.h>
......@@ -301,6 +302,10 @@ void Core::soundcardHintCheck () {
LinphoneConfig *config = linphone_core_get_config(L_GET_C_BACK_PTR(this));
bool useRtpIo = !!lp_config_get_int(config, "sound", "rtp_io", FALSE);
bool useRtpIoEnableLocalOutput = !!lp_config_get_int(config, "sound", "rtp_io_enable_local_output", FALSE);
LinphoneConference *conf_ctx = getCCore()->conf_ctx;
if (conf_ctx && linphone_conference_get_size(conf_ctx) >= 1) return;
bool useFiles = L_GET_C_BACK_PTR(getSharedFromThis())->use_files;
if ((!d->hasCalls() || noNeedForSound)
&& (!useFiles && (!useRtpIo || (useRtpIo && useRtpIoEnableLocalOutput)))) {
......
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