From 9c2b53b3ed8c2e57757f3705dd8163db8162496b Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 24 Nov 2021 10:11:31 -0500 Subject: [PATCH] TT#147800 don't clutter output dict with empty SSRC entries SSRC entries might be present for the same SSRC in multiple contexts, but only one of them will hold the actual stats. Don't create output SSRC entries unless we know they won't be empty, as otherwise we won't be able to create the actual SSRC entries (with stats) later on as they dict key will already exist. Change-Id: I54e263a17e14869ebb98456963f8ca75d11e9a89 --- daemon/call_interfaces.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 2e2ffce32..83e7de1f9 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -1850,11 +1850,11 @@ static void ng_stats_ssrc(bencode_item_t *dict, struct ssrc_hash *ht) { snprintf(tmp, 12, "%" PRIu32, se->h.ssrc); if (bencode_dictionary_get(dict, tmp)) continue; - bencode_item_t *ent = bencode_dictionary_add_dictionary(dict, tmp); - if (!se->stats_blocks.length || !se->lowest_mos || !se->highest_mos) continue; + bencode_item_t *ent = bencode_dictionary_add_dictionary(dict, tmp); + bencode_dictionary_add_integer(ent, "cumulative loss", se->packets_lost); int mos_samples = se->stats_blocks.length - se->no_mos_count;