max-mos: is often invalid when RTCP was not

received on both legs since we are using RTT mos-cq (conversational
quality), we should not compute it when we have only the RTT from one
leg.
pull/1218/head
Julien Chavanton 4 years ago committed by Julien Chavanton
parent 3791b8f595
commit bcf70cf6d5

@ -60,6 +60,9 @@ static void ssrc_entry_put(void *ep) {
// returned as mos * 10 (i.e. 10 - 50 for 1.0 to 5.0) // returned as mos * 10 (i.e. 10 - 50 for 1.0 to 5.0)
static void mos_calc(struct ssrc_stats_block *ssb) { static void mos_calc(struct ssrc_stats_block *ssb) {
if (!ssb->rtt)
return; // can not compute the MOS-CQ unless we have a valid RTT
// as per https://www.pingman.com/kb/article/how-is-mos-calculated-in-pingplotter-pro-50.html // as per https://www.pingman.com/kb/article/how-is-mos-calculated-in-pingplotter-pro-50.html
int eff_rtt = ssb->rtt / 1000 + ssb->jitter * 2 + 10; int eff_rtt = ssb->rtt / 1000 + ssb->jitter * 2 + 10;
double r; // XXX can this be done with int math? double r; // XXX can this be done with int math?
@ -359,7 +362,7 @@ void ssrc_receiver_report(struct call_media *m, const struct ssrc_receiver_repor
struct ssrc_stats_block *ssb = g_slice_alloc(sizeof(*ssb)); struct ssrc_stats_block *ssb = g_slice_alloc(sizeof(*ssb));
*ssb = (struct ssrc_stats_block) { *ssb = (struct ssrc_stats_block) {
.jitter = jitter, .jitter = jitter,
.rtt = rtt + other_e->last_rtt, .rtt = other_e->last_rtt ? (rtt + other_e->last_rtt) : 0,
.rtt_leg = rtt, .rtt_leg = rtt,
.reported = *tv, .reported = *tv,
.packetloss = (unsigned int) rr->fraction_lost * 100 / 256, .packetloss = (unsigned int) rr->fraction_lost * 100 / 256,

Loading…
Cancel
Save