diff --git a/coreapi/bellesip_sal/sal_sdp.c b/coreapi/bellesip_sal/sal_sdp.c index 0ee29e6da..50e3504a5 100644 --- a/coreapi/bellesip_sal/sal_sdp.c +++ b/coreapi/bellesip_sal/sal_sdp.c @@ -117,7 +117,7 @@ static void stream_description_to_sdp ( belle_sdp_session_description_t *session mime_param= belle_sdp_mime_parameter_create ( pt->mime_type , payload_type_get_number ( pt ) , pt->clock_rate - ,stream->type==SalAudio?1:-1 ); + , pt->channels>0 ? pt->channels : -1 ); belle_sdp_mime_parameter_set_parameters ( mime_param,pt->recv_fmtp ); if ( stream->ptime>0 ) { belle_sdp_mime_parameter_set_ptime ( mime_param,stream->ptime ); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index c31d1c181..b15bd71b4 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1377,7 +1377,7 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab linphone_core_assign_payload_type(lc,&payload_type_g729,18,"annexb=no"); linphone_core_assign_payload_type(lc,&payload_type_aaceld_22k,-1,"config=F8EE2000; constantDuration=512; indexDeltaLength=3; indexLength=3; mode=AAC-hbr; profile-level-id=76; sizeLength=13; streamType=5"); linphone_core_assign_payload_type(lc,&payload_type_aaceld_44k,-1,"config=F8E82000; constantDuration=512; indexDeltaLength=3; indexLength=3; mode=AAC-hbr; profile-level-id=76; sizeLength=13; streamType=5"); - linphone_core_assign_payload_type(lc,&payload_type_opus,-1,"useinbandfec=1; usedtx=0; cbr=1"); + linphone_core_assign_payload_type(lc,&payload_type_opus,-1,"useinbandfec=1; stereo=0; sprop-stereo=0"); linphone_core_assign_payload_type(lc,&payload_type_isac,-1,NULL); linphone_core_handle_static_payloads(lc); diff --git a/coreapi/misc.c b/coreapi/misc.c index b1e9f2235..fed8191b4 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -168,12 +168,6 @@ bool_t linphone_core_is_payload_type_usable_for_bandwidth(LinphoneCore *lc, Payl case PAYLOAD_AUDIO_PACKETIZED: codec_band=get_audio_payload_bandwidth(lc,pt); ret=bandwidth_is_greater(bandwidth_limit*1000,codec_band); - /*hack to avoid using uwb codecs when having low bitrate and video*/ - if (bandwidth_is_greater(199,bandwidth_limit)){ - if (linphone_core_video_enabled(lc) && pt->clock_rate>16000){ - ret=FALSE; - } - } //ms_message("Payload %s: %g",pt->mime_type,codec_band); break; case PAYLOAD_VIDEO: diff --git a/coreapi/offeranswer.c b/coreapi/offeranswer.c index df4e7507d..db2a28b76 100644 --- a/coreapi/offeranswer.c +++ b/coreapi/offeranswer.c @@ -39,11 +39,20 @@ static PayloadType * find_payload_type_best_match(const MSList *l, const Payload for (elem=l;elem!=NULL;elem=elem->next){ pt=(PayloadType*)elem->data; + + /*workaround a bug in earlier versions of linphone where opus/48000/1 is offered, which is uncompliant with opus rtp draft*/ + if (refpt->mime_type && strcasecmp(refpt->mime_type,"opus")==0 && refpt->channels==1 + && strcasecmp(pt->mime_type,refpt->mime_type)==0){ + pt->channels=1; /*so that we respond with same number of channels */ + candidate=pt; + break; + } + /* the compare between G729 and G729A is for some stupid uncompliant phone*/ if ( pt->mime_type && refpt->mime_type && (strcasecmp(pt->mime_type,refpt->mime_type)==0 || (strcasecmp(pt->mime_type, "G729") == 0 && strcasecmp(refpt->mime_type, "G729A") == 0 )) - && pt->clock_rate==refpt->clock_rate){ + && pt->clock_rate==refpt->clock_rate && pt->channels==refpt->channels){ candidate=pt; /*good candidate, check fmtp for H264 */ if (strcasecmp(pt->mime_type,"H264")==0){ @@ -106,7 +115,9 @@ static MSList *match_payloads(const MSList *local, const MSList *remote, bool_t res=ms_list_append(res,newp); } }else{ - ms_message("No match for %s/%i",p2->mime_type,p2->clock_rate); + if (p2->channels>0) + ms_message("No match for %s/%i/%i",p2->mime_type,p2->clock_rate,p2->channels); + else ms_message("No match for %s/%i",p2->mime_type,p2->clock_rate); } } if (reading_response){ diff --git a/mediastreamer2 b/mediastreamer2 index f6c6813f0..7f97a5c70 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit f6c6813f0cdffaaa290d3933b7f6a92d586bae72 +Subproject commit 7f97a5c7046589f4de0a742a686308ad5770348d diff --git a/oRTP b/oRTP index c09e63ddb..c329c3a47 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit c09e63ddba599a7f7da149edf6f7b290f4cfa787 +Subproject commit c329c3a478011ed4c10ffca79b8624ec6b60450c