diff --git a/daemon/call.c b/daemon/call.c index afcdf0f70..d0764aeb0 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -5354,7 +5354,7 @@ void call_destroy(call_t *c) { if (!se->stats_blocks.length || !se->lowest_mos || !se->highest_mos) continue; - int mos_samples = (se->stats_blocks.length - se->no_mos_count); + int mos_samples = se->mos_samples; if (mos_samples < 1) mos_samples = 1; ilog(LOG_INFO, "--- SSRC %s%" PRIx32 "%s", FMT_M(se->h.ssrc)); diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index fcc0587c7..3b9f0c388 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -1144,7 +1144,7 @@ static void ng_stats_ssrc_1(const ng_parser_t *parser, parser_arg ent, struct ss parser->dict_add_int(ent, "cumulative loss", se->packets_lost); - int mos_samples = se->stats_blocks.length - se->no_mos_count; + int mos_samples = se->mos_samples; if (mos_samples < 1) mos_samples = 1; ng_stats_ssrc_mos_entry_dict_avg(parser, ent, "average MOS", &se->average_mos, mos_samples); ng_stats_ssrc_mos_entry_dict(parser, ent, "lowest MOS", se->lowest_mos); diff --git a/daemon/ssrc.c b/daemon/ssrc.c index 7c20c149d..2d77bd77a 100644 --- a/daemon/ssrc.c +++ b/daemon/ssrc.c @@ -516,9 +516,8 @@ void ssrc_receiver_report(struct call_media *m, stream_fd *sfd, const struct ssr other_e->highest_mos = ssb; // running tally - if (!ssb->mos) { // when we do not have the RTT for both legs, we have no MOS - other_e->no_mos_count++; - } else { + if (ssb->mos) { // when we do not have the RTT for both legs, we have no MOS + other_e->mos_samples++; other_e->average_mos.jitter += ssb->jitter; other_e->average_mos.mos += ssb->mos; other_e->average_mos.rtt += ssb->rtt; diff --git a/include/ssrc.h b/include/ssrc.h index 66087ba1b..46840f831 100644 --- a/include/ssrc.h +++ b/include/ssrc.h @@ -74,7 +74,7 @@ struct ssrc_entry_call { struct ssrc_stats_block *lowest_mos, *highest_mos, average_mos; // contains a running tally of all stats blocks - uint16_t no_mos_count; // how many time we where not able to compute MOS due to missing RTT + unsigned int mos_samples; // for average_mos math unsigned int last_rtt; // last calculated raw rtt without rtt from opposide side unsigned int last_rtt_xr; // last rtt for both legs retrieved from RTCP-XR BT-7