]> sjero.net Git - linphone/commitdiff
fix for early media and multi call
authorSimon Morlat <simon.morlat@linphone.org>
Thu, 13 Oct 2011 13:59:23 +0000 (15:59 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Thu, 13 Oct 2011 13:59:23 +0000 (15:59 +0200)
coreapi/linphonecall.c
coreapi/linphonecore.c
coreapi/private.h

index ba7c71182c930212004a438291316dd1b63a7787..15b1aa72325a59868ab810f7664713dc61ac600f 100644 (file)
@@ -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);
index 75cc94f38888e83baebab801499ba78dd9d7a1ba..3a21ae70135241ed9bf815d0012ea3ca8dc492fb 100644 (file)
@@ -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;
        }
index e662c8e7533d28f2ae62db7d90059d1b647df811..d2b78942ea4bbc17f249ad56547decb90e2eec52 100644 (file)
@@ -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)