Commit d2dd8fd3 authored by Simon Morlat's avatar Simon Morlat

fix bug when setting up tone files for tone ids. Update ms2 and ortp for...

fix bug when setting up tone files for tone ids. Update ms2 and ortp for jitter buffer improvements.
parent 9b6643b6
......@@ -2453,7 +2453,7 @@ static void apply_jitter_buffer_params(LinphoneCore *lc, RtpSession *session, Li
rtp_session_get_jitter_buffer_params(session, &params);
params.min_size = lp_config_get_int(lc->config, "rtp", "jitter_buffer_min_size", 40);
params.max_size = lp_config_get_int(lc->config, "rtp", "jitter_buffer_max_size", 500);
params.max_size = lp_config_get_int(lc->config, "rtp", "jitter_buffer_max_size", 250);
params.max_packets = params.max_size * 200 / 1000; /*allow 200 packet per seconds, quite large*/
params.buffer_algorithm = name_to_jb_algo(lp_config_get_string(lc->config, "rtp", "jitter_buffer_algorithm", "rls"));
params.refresh_ms = lp_config_get_int(lc->config, "rtp", "jitter_buffer_refresh_period", 5000);
......
......@@ -5760,7 +5760,7 @@ void linphone_core_play_call_error_tone(LinphoneCore *lc, LinphoneReason reason)
if (tone){
if (tone->audiofile){
linphone_core_play_local(lc,tone->audiofile);
}else if (tone->toneid!=LinphoneToneUndefined){
}else if (tone->toneid != LinphoneToneUndefined){
linphone_core_play_named_tone(lc,tone->toneid);
}
}
......
......@@ -1349,22 +1349,26 @@ void linphone_tone_description_destroy(LinphoneToneDescription *obj){
ms_free(obj);
}
LinphoneToneDescription *linphone_core_get_call_error_tone(const LinphoneCore *lc, LinphoneReason reason){
static LinphoneToneDescription *linphone_core_lookup_tone(const LinphoneCore *lc, LinphoneReason reason, LinphoneToneID id){
const bctbx_list_t *elem;
for (elem=lc->tones;elem!=NULL;elem=elem->next){
LinphoneToneDescription *tone=(LinphoneToneDescription*)elem->data;
if (tone->reason==reason) return tone;
if (reason == LinphoneReasonNone){
if (tone->toneid == id && tone->reason == LinphoneReasonNone) return tone;
}else{
if (tone->reason==reason) return tone;
}
}
return NULL;
}
LinphoneToneDescription *linphone_core_get_call_error_tone(const LinphoneCore *lc, LinphoneReason reason){
return linphone_core_lookup_tone(lc, reason, LinphoneToneUndefined);
}
const char *linphone_core_get_tone_file(const LinphoneCore *lc, LinphoneToneID id){
const bctbx_list_t *elem;
for (elem=lc->tones;elem!=NULL;elem=elem->next){
LinphoneToneDescription *tone=(LinphoneToneDescription*)elem->data;
if (tone->toneid==id && tone->reason==LinphoneReasonNone && tone->audiofile!=NULL) return tone->audiofile;
}
return NULL;
LinphoneToneDescription *tone = linphone_core_lookup_tone(lc, LinphoneReasonNone, id);
return tone ? tone->audiofile : NULL;
}
void _linphone_core_set_tone(LinphoneCore *lc, LinphoneReason reason, LinphoneToneID id, const char *audiofile){
......
......@@ -930,9 +930,10 @@ typedef struct autoreplier_config
typedef struct _LinphoneToneDescription{
LinphoneReason reason;
LinphoneToneID toneid;
char *audiofile;
LinphoneReason reason; /*the call error code*/
LinphoneToneID toneid; /*A tone type to play when this error arrives. This is played using tone generator*/
char *audiofile; /*An override audio file to play instead, when this error arrives*/
/*Note that some tones are not affected to any error, in which case it is affected LinphoneReasonNone*/
}LinphoneToneDescription;
LinphoneToneDescription * linphone_tone_description_new(LinphoneReason reason, LinphoneToneID id, const char *audiofile);
......
mediastreamer2 @ d0893a42
Subproject commit 0afcf325be1517ba67fcccb09d3672f1656eff82
Subproject commit d0893a42924403ac875100c3d1ed26b78ceff96f
oRTP @ 8b89ebee
Subproject commit 3ec4c4b24353c5ad1221ea462f8125840254568f
Subproject commit 8b89ebee6e211a687d35d7d1ceb8bfb4e5febe1a
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