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
(cherry picked from commit 9c2b53b3ed)
mr10.0.1
Richard Fuchs 4 years ago
parent 5a050c06e6
commit d6ba159af4

@ -1818,11 +1818,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;

Loading…
Cancel
Save