From c050b2449aca699866476e6bca7e15a9d4862128 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 3 Jan 2018 10:59:55 +0100 Subject: [PATCH] Fix crash in quality reporting. --- coreapi/quality_reporting.c | 6 +++--- src/call/call-p.h | 1 + src/call/call.cpp | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/coreapi/quality_reporting.c b/coreapi/quality_reporting.c index 8950b5970..571a8faa0 100644 --- a/coreapi/quality_reporting.c +++ b/coreapi/quality_reporting.c @@ -612,11 +612,11 @@ void linphone_reporting_on_rtcp_update(LinphoneCall *call, SalStreamType stats_t int report_interval; if (stats_type == 0) { - stats = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getStats(LinphoneStreamTypeAudio); + stats = L_GET_PRIVATE_FROM_C_OBJECT(call)->getStats(LinphoneStreamTypeAudio); } else if (stats_type == 1) { - stats = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getStats(LinphoneStreamTypeVideo); + stats = L_GET_PRIVATE_FROM_C_OBJECT(call)->getStats(LinphoneStreamTypeVideo); } else { - stats = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getStats(LinphoneStreamTypeText); + stats = L_GET_PRIVATE_FROM_C_OBJECT(call)->getStats(LinphoneStreamTypeText); } if (! media_report_enabled(call,stats_type)) diff --git a/src/call/call-p.h b/src/call/call-p.h index 523062e7c..ec6cd8e5c 100644 --- a/src/call/call-p.h +++ b/src/call/call-p.h @@ -59,6 +59,7 @@ public: bool getRingingBeep () const { return ringingBeep; } void setAudioMuted (bool value); void setRingingBeep (bool value) { ringingBeep = value; } + LinphoneCallStats *getStats (LinphoneStreamType type) const; void createPlayer () const; diff --git a/src/call/call.cpp b/src/call/call.cpp index a11f185c3..dc9efd3a9 100644 --- a/src/call/call.cpp +++ b/src/call/call.cpp @@ -61,6 +61,10 @@ void CallPrivate::setAudioMuted (bool value) { static_pointer_cast(getActiveSession())->getPrivate()->setAudioMuted(value); } +LinphoneCallStats *CallPrivate::getStats (LinphoneStreamType type) const { + return static_pointer_cast(getActiveSession())->getPrivate()->getStats(type); +} + // ----------------------------------------------------------------------------- void CallPrivate::initiateIncoming () {