diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 8be79bec2..a84960b60 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -2453,7 +2453,7 @@ static void apply_jitter_buffer_params(LinphoneCore *lc, RtpSession *session, Li rtp_session_get_jitter_buffer_params(session, ¶ms); 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); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index ff8812212..6f1f7df9f 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -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); } } diff --git a/coreapi/misc.c b/coreapi/misc.c index 5b3cdb9e0..fa50c17c3 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -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){ diff --git a/coreapi/private.h b/coreapi/private.h index 6170f6ba9..0f1e234dd 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -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); diff --git a/mediastreamer2 b/mediastreamer2 index 0afcf325b..d0893a429 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 0afcf325be1517ba67fcccb09d3672f1656eff82 +Subproject commit d0893a42924403ac875100c3d1ed26b78ceff96f diff --git a/oRTP b/oRTP index 3ec4c4b24..8b89ebee6 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 3ec4c4b24353c5ad1221ea462f8125840254568f +Subproject commit 8b89ebee6e211a687d35d7d1ceb8bfb4e5febe1a