Commit d6bbd3db authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Fix text payloads order (red first, t140 after) and added fmtp parameter for red payload

parent 93c593da
......@@ -297,6 +297,8 @@ bool_t is_payload_type_number_available(const MSList *l, int number, const Paylo
static void linphone_core_assign_payload_type_numbers(LinphoneCore *lc, MSList *codecs){
MSList *elem;
int dyn_number=lc->codecs_conf.dyn_pt;
int t140_payload_type_number = 0;
for (elem=codecs; elem!=NULL; elem=elem->next){
PayloadType *pt=(PayloadType*)elem->data;
int number=payload_type_get_number(pt);
......@@ -323,6 +325,18 @@ static void linphone_core_assign_payload_type_numbers(LinphoneCore *lc, MSList *
payload_type_set_enable(pt, FALSE);
}
}
if (strcmp(pt->mime_type, payload_type_t140_red.mime_type) == 0) {
if (number == -1) {
t140_payload_type_number = dyn_number;
} else {
t140_payload_type_number = number;
}
if (t140_payload_type_number > 0) {
const char *red_fmtp = ms_strdup_printf("%i/%i/%i", t140_payload_type_number, t140_payload_type_number, t140_payload_type_number);
payload_type_set_recv_fmtp(pt, red_fmtp);
}
}
}
}
......
......@@ -1609,8 +1609,10 @@ static void linphone_core_register_default_codecs(LinphoneCore *lc){
linphone_core_register_payload_type(lc,&payload_type_speex_nb,"vbr=on",TRUE);
linphone_core_register_payload_type(lc,&payload_type_pcmu8000,NULL,TRUE);
linphone_core_register_payload_type(lc,&payload_type_pcma8000,NULL,TRUE);
linphone_core_register_payload_type(lc,&payload_type_t140,NULL,TRUE);
linphone_core_register_payload_type(lc,&payload_type_t140_red,NULL,TRUE);
/* Text codecs in order or preference (RED first (more robust), then T140) */
linphone_core_register_payload_type(lc, &payload_type_t140_red, NULL, TRUE);
linphone_core_register_payload_type(lc, &payload_type_t140, NULL, TRUE);
/*other audio codecs, not enabled by default, in order of preference*/
linphone_core_register_payload_type(lc,&payload_type_gsm,NULL,FALSE);
......
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