mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-19 03:58:08 +00:00
Add checks to prevent crashes.
The getReceiverInterarrivalJitter() function may be called before the used audio codec is known in case of early media, so test that the payload type is valid before using it.
This commit is contained in:
parent
362d77908a
commit
06d8cec790
1 changed files with 4 additions and 0 deletions
|
|
@ -1372,6 +1372,8 @@ extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getSenderInterarr
|
|||
pt = linphone_call_params_get_used_audio_codec(params);
|
||||
else
|
||||
pt = linphone_call_params_get_used_video_codec(params);
|
||||
if (!pt || (pt->clock_rate == 0))
|
||||
return (jfloat)0.0;
|
||||
return (jfloat)((float)report_block_get_interarrival_jitter(srb) / (float)pt->clock_rate);
|
||||
}
|
||||
extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getReceiverInterarrivalJitter(JNIEnv *env, jobject thiz, jlong stats_ptr, jlong call_ptr) {
|
||||
|
|
@ -1399,6 +1401,8 @@ extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getReceiverIntera
|
|||
pt = linphone_call_params_get_used_audio_codec(params);
|
||||
else
|
||||
pt = linphone_call_params_get_used_video_codec(params);
|
||||
if (!pt || (pt->clock_rate == 0))
|
||||
return (jfloat)0.0;
|
||||
return (jfloat)((float)report_block_get_interarrival_jitter(rrb) / (float)pt->clock_rate);
|
||||
}
|
||||
extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getRoundTripDelay(JNIEnv *env, jobject thiz, jlong stats_ptr) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue