Commit 787e9d2a authored by Simon Morlat's avatar Simon Morlat
Browse files

fix for early media and multi call

parent d855429a
......@@ -975,6 +975,13 @@ static void setup_ring_player(LinphoneCore *lc, LinphoneCall *call){
#define LINPHONE_RTCP_SDES_TOOL "Linphone-" LINPHONE_VERSION
static bool_t linphone_call_sound_resources_available(LinphoneCall *call){
LinphoneCore *lc=call->core;
LinphoneCall *current=linphone_core_get_current_call(lc);
return !linphone_core_is_in_conference(lc) &&
(current==NULL || current==call);
}
static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cname, bool_t muted, bool_t send_ringbacktone, bool_t use_arc){
LinphoneCore *lc=call->core;
int jitt_comp=lc->rtp_conf.audio_jitt_comp;
......@@ -1023,6 +1030,10 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cna
/* first create the graph without soundcard resources*/
captcard=playcard=NULL;
}
if (!linphone_call_sound_resources_available(call)){
ms_message("Sound resources are used by another call, not using soundcard.");
captcard=playcard=NULL;
}
use_ec=captcard==NULL ? FALSE : linphone_core_echo_cancellation_enabled(lc);
audio_stream_enable_adaptive_bitrate_control(call->audiostream,use_arc);
......
......@@ -2562,8 +2562,10 @@ int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *the_call)
linphone_core_preempt_sound_resources(lc);
ms_message("Resuming call %p",call);
}
update_local_media_description(lc,the_call,&call->localdesc);
sal_call_set_local_media_description(call->op,call->localdesc);
sal_media_description_set_dir(call->localdesc,SalStreamSendRecv);
if (call->params.in_conference) subject="Resuming conference";
if (call->params.in_conference && !call->current_params.in_conference) subject="Conference";
if(sal_call_update(call->op,subject) != 0){
return -1;
}
......
......@@ -516,6 +516,7 @@ void _post_configure_audio_stream(AudioStream *st, LinphoneCore *lc, bool_t mute
void linphone_call_add_to_conf(LinphoneCall *call);
void linphone_call_remove_from_conf(LinphoneCall *call);
void linphone_core_conference_check_uninit(LinphoneConference *ctx);
bool_t linphone_core_sound_resources_available(LinphoneCore *lc);
#define HOLD_OFF (0)
#define HOLD_ON (1)
......
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