Browse Source

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
pull/1407/head
Richard Fuchs 4 years ago
parent
commit
9c2b53b3ed
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      daemon/call_interfaces.c

+ 2
- 2
daemon/call_interfaces.c View File

@ -1850,11 +1850,11 @@ static void ng_stats_ssrc(bencode_item_t *dict, struct ssrc_hash *ht) {
snprintf(tmp, 12, "%" PRIu32, se->h.ssrc); snprintf(tmp, 12, "%" PRIu32, se->h.ssrc);
if (bencode_dictionary_get(dict, tmp)) if (bencode_dictionary_get(dict, tmp))
continue; continue;
bencode_item_t *ent = bencode_dictionary_add_dictionary(dict, tmp);
if (!se->stats_blocks.length || !se->lowest_mos || !se->highest_mos) if (!se->stats_blocks.length || !se->lowest_mos || !se->highest_mos)
continue; continue;
bencode_item_t *ent = bencode_dictionary_add_dictionary(dict, tmp);
bencode_dictionary_add_integer(ent, "cumulative loss", se->packets_lost); bencode_dictionary_add_integer(ent, "cumulative loss", se->packets_lost);
int mos_samples = se->stats_blocks.length - se->no_mos_count; int mos_samples = se->stats_blocks.length - se->no_mos_count;


Loading…
Cancel
Save