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

Fix crash in quality reporting when call with audio, video and text + fix...

Fix crash in quality reporting when call with audio, video and text + fix future index out of bound issue (if main stream index > 3)
parent 61061fa3
......@@ -281,6 +281,7 @@ static void _linphone_call_log_destroy(LinphoneCallLog *cl) {
if (cl->call_id) ms_free(cl->call_id);
if (cl->reporting.reports[LINPHONE_CALL_STATS_AUDIO]!=NULL) linphone_reporting_destroy(cl->reporting.reports[LINPHONE_CALL_STATS_AUDIO]);
if (cl->reporting.reports[LINPHONE_CALL_STATS_VIDEO]!=NULL) linphone_reporting_destroy(cl->reporting.reports[LINPHONE_CALL_STATS_VIDEO]);
if (cl->reporting.reports[LINPHONE_CALL_STATS_TEXT]!=NULL) linphone_reporting_destroy(cl->reporting.reports[LINPHONE_CALL_STATS_TEXT]);
}
LinphoneCallLog * linphone_call_log_new(LinphoneCallDir dir, LinphoneAddress *from, LinphoneAddress *to) {
......@@ -296,6 +297,7 @@ LinphoneCallLog * linphone_call_log_new(LinphoneCallDir dir, LinphoneAddress *fr
cl->reporting.reports[LINPHONE_CALL_STATS_AUDIO]=linphone_reporting_new();
cl->reporting.reports[LINPHONE_CALL_STATS_VIDEO]=linphone_reporting_new();
cl->reporting.reports[LINPHONE_CALL_STATS_TEXT]=linphone_reporting_new();
cl->connected_date_time=0;
return cl;
}
......
......@@ -4262,15 +4262,16 @@ void linphone_call_stats_uninit(LinphoneCallStats *stats){
}
void linphone_call_notify_stats_updated(LinphoneCall *call, int stream_index){
LinphoneCallStats *stats=&call->stats[stream_index];
LinphoneCore *lc=call->core;
LinphoneCallStats *stats = &call->stats[stream_index];
LinphoneCore *lc = call->core;
if (stats->updated){
switch(stats->updated) {
case LINPHONE_CALL_STATS_RECEIVED_RTCP_UPDATE:
case LINPHONE_CALL_STATS_SENT_RTCP_UPDATE:
linphone_reporting_on_rtcp_update(call, stream_index);
linphone_reporting_on_rtcp_update(call, stream_index == call->main_audio_stream_index ? SalAudio : stream_index == call->main_video_stream_index ? SalVideo : SalText);
break;
default:
break;
default:break;
}
linphone_core_notify_call_stats_updated(lc, call, stats);
stats->updated = 0;
......
......@@ -153,7 +153,7 @@ BELLE_SIP_DECLARE_VPTR(LinphoneCallParams);
struct _LinphoneQualityReporting{
reporting_session_report_t * reports[2]; /**Store information on audio and video media streams (RFC 6035) */
reporting_session_report_t * reports[3]; /**Store information on audio and video media streams (RFC 6035) */
bool_t was_video_running; /*Keep video state since last check in order to detect its (de)activation*/
LinphoneQualityReportingReportSendCb on_report_sent;
};
......
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