mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-30 01:39:20 +00:00
improve handling of legacy (buggy) opus payload type declarations: do not modify the local payload type.
This commit is contained in:
parent
723c628996
commit
fa7d1c1733
1 changed files with 8 additions and 4 deletions
|
|
@ -35,7 +35,7 @@ static bool_t only_telephone_event(const MSList *l){
|
|||
static PayloadType * opus_match(MSOfferAnswerContext *ctx, const MSList *local_payloads, const PayloadType *refpt, const MSList *remote_payloads, bool_t reading_response){
|
||||
PayloadType *pt;
|
||||
const MSList *elem;
|
||||
PayloadType *candidate=NULL;
|
||||
PayloadType *legacy_opus=NULL;
|
||||
|
||||
for (elem=local_payloads;elem!=NULL;elem=elem->next){
|
||||
pt=(PayloadType*)elem->data;
|
||||
|
|
@ -43,14 +43,18 @@ static PayloadType * opus_match(MSOfferAnswerContext *ctx, const MSList *local_p
|
|||
/*workaround a bug in earlier versions of linphone where opus/48000/1 is offered, which is uncompliant with opus rtp draft*/
|
||||
if (strcasecmp(pt->mime_type,"opus")==0 ){
|
||||
if (refpt->channels==1){
|
||||
pt->channels=1; /*so that we respond with same number of channels */
|
||||
candidate=pt;
|
||||
legacy_opus=pt;
|
||||
}else if (refpt->channels==2){
|
||||
return payload_type_clone(pt);
|
||||
}
|
||||
}
|
||||
}
|
||||
return candidate ? payload_type_clone(candidate) : NULL;
|
||||
if (legacy_opus){
|
||||
legacy_opus = payload_type_clone(legacy_opus);
|
||||
legacy_opus->channels=1; /*so that we respond with same number of channels */
|
||||
return legacy_opus;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static MSOfferAnswerContext *opus_offer_answer_create_context(void){
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue