diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index c3264d99b..97c1245a5 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -859,7 +859,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut { const SalStreamDescription *stream=sal_media_description_find_stream(call->resultdesc, SalProtoRtpAvp,SalAudio); - if (stream && stream->dir!=SalStreamInactive){ + if (stream && stream->dir!=SalStreamInactive && stream->port!=0){ MSSndCard *playcard=lc->sound_conf.lsd_card ? lc->sound_conf.lsd_card : lc->sound_conf.play_sndcard; MSSndCard *captcard=lc->sound_conf.capt_sndcard; @@ -941,7 +941,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut lc->previewstream=NULL; } call->current_params.has_video=FALSE; - if (vstream && vstream->dir!=SalStreamInactive) { + if (vstream && vstream->dir!=SalStreamInactive && vstream->port!=0) { const char *addr=vstream->addr[0]!='\0' ? vstream->addr : call->resultdesc->addr; call->video_profile=make_profile(call,call->resultdesc,vstream,&used_pt); if (used_pt!=-1){ diff --git a/coreapi/offeranswer.c b/coreapi/offeranswer.c index 10d062abf..cbc88c2c1 100644 --- a/coreapi/offeranswer.c +++ b/coreapi/offeranswer.c @@ -232,7 +232,6 @@ int offer_answer_initiate_incoming(const SalMediaDescription *local_capabilities result->streams[i].dir=SalStreamInactive; result->streams[i].port=0; result->streams[i].type=rs->type; - result->streams[i].payloads=remote_offer->streams[i].payloads; if (rs->type==SalOther){ strncpy(result->streams[i].typeother,rs->typeother,sizeof(rs->typeother)-1); } diff --git a/coreapi/sal_eXosip2_sdp.c b/coreapi/sal_eXosip2_sdp.c index 82e1fb509..3993e66f8 100644 --- a/coreapi/sal_eXosip2_sdp.c +++ b/coreapi/sal_eXosip2_sdp.c @@ -241,8 +241,14 @@ static void add_line(sdp_message_t *msg, int lineno, const SalStreamDescription if (desc->ptime>0) sdp_message_a_attribute_add(msg,lineno,osip_strdup("ptime"), int_2char(desc->ptime)); strip_well_known_rtpmaps=ms_list_size(desc->payloads)>5; - for(elem=desc->payloads;elem!=NULL;elem=elem->next){ - add_payload(msg, lineno, (PayloadType*)elem->data,strip_well_known_rtpmaps); + if (desc->payloads){ + for(elem=desc->payloads;elem!=NULL;elem=elem->next){ + add_payload(msg, lineno, (PayloadType*)elem->data,strip_well_known_rtpmaps); + } + }else{ + /* to comply with SDP we cannot have an empty payload type number list */ + /* as it happens only when mline is declined with a zero port, it does not matter to put whatever codec*/ + sdp_message_m_payload_add (msg,lineno, int_2char (0)); } switch(desc->dir){ case SalStreamSendRecv: diff --git a/mediastreamer2 b/mediastreamer2 index 92316f7a8..8b9173fca 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 92316f7a8793fe30e0d111d4b9043b76dcb8e726 +Subproject commit 8b9173fca31595a48c7ef597edb412aea2d2871f