LLVMFuzzerTestOneInput:
   26|    499|{
   27|    499|    static thread_local struct rtpp_log *log;
   28|    499|    static thread_local struct rtpp_analyzer *rap;
   29|    499|    struct rtp_packet *pktp;
   30|       |
   31|    499|    if (size > MAX_RPKT_LEN)
  ------------------
  |  |   38|    499|#define MAX_RPKT_LEN 8192
  ------------------
  |  Branch (31:9): [True: 9, False: 490]
  ------------------
   32|      9|        return (0);
   33|       |
   34|    490|    if (log == NULL) {
  ------------------
  |  Branch (34:9): [True: 1, False: 489]
  ------------------
   35|      1|        assert(rtpp_gen_uid_init() == 0);
   36|      1|        log = rtpp_log_ctor("rtpproxy", NULL, LF_REOPEN);
  ------------------
  |  |   42|      1|#define LF_REOPEN 0
  ------------------
   37|      1|        assert(log != NULL);
   38|      1|        rap = rtpp_analyzer_ctor(log);
   39|      1|        assert(rap != NULL);
   40|      1|    }
   41|       |
   42|    490|    pktp = rtp_packet_alloc();
   43|    490|    assert(pktp != NULL);
   44|    490|    pktp->size = size;
   45|    490|    memcpy(pktp->data.buf, data, size);
   46|       |
   47|    490|    CALL_SMETHOD(rap, update, pktp);
  ------------------
  |  |  134|    490|#define CALL_SMETHOD(obj, method, args...) GET_SMETHODS(obj)->method(obj, ## args)
  |  |  ------------------
  |  |  |  |  107|    490|#define GET_SMETHODS(obj) _Generic((obj), \
  |  |  |  |  108|    490|    struct rtpp_refcnt *: rtpp_refcnt_smethods, \
  |  |  |  |  109|    490|    struct rtpp_pearson_perfect *: rtpp_pearson_perfect_smethods, \
  |  |  |  |  110|    490|    struct rtpp_netaddr *: rtpp_netaddr_smethods, \
  |  |  |  |  111|    490|    struct rtpp_server *: rtpp_server_smethods, \
  |  |  |  |  112|    490|    struct rtpp_stats *: rtpp_stats_smethods, \
  |  |  |  |  113|    490|    struct rtpp_timed *: rtpp_timed_smethods, \
  |  |  |  |  114|    490|    struct rtpp_stream *: rtpp_stream_smethods, \
  |  |  |  |  115|    490|    struct rtpp_pcount *: rtpp_pcount_smethods, \
  |  |  |  |  116|    490|    struct rtpp_record *: rtpp_record_smethods, \
  |  |  |  |  117|    490|    struct rtpp_hash_table *: rtpp_hash_table_smethods, \
  |  |  |  |  118|    490|    struct rtpp_weakref *: rtpp_weakref_smethods, \
  |  |  |  |  119|    490|    struct rtpp_analyzer *: rtpp_analyzer_smethods, \
  |  |  |  |  120|    490|    struct rtpp_pcnt_strm *: rtpp_pcnt_strm_smethods, \
  |  |  |  |  121|    490|    struct rtpp_ttl *: rtpp_ttl_smethods, \
  |  |  |  |  122|    490|    struct rtpp_pipe *: rtpp_pipe_smethods, \
  |  |  |  |  123|    490|    struct rtpp_ringbuf *: rtpp_ringbuf_smethods, \
  |  |  |  |  124|    490|    struct rtpp_sessinfo *: rtpp_sessinfo_smethods, \
  |  |  |  |  125|    490|    struct rtpp_rw_lock *: rtpp_rw_lock_smethods, \
  |  |  |  |  126|    490|    struct rtpp_proc_servers *: rtpp_proc_servers_smethods, \
  |  |  |  |  127|    490|    struct rtpp_proc_wakeup *: rtpp_proc_wakeup_smethods, \
  |  |  |  |  128|    490|    struct pproc_manager *: pproc_manager_smethods \
  |  |  |  |  129|    490|)
  |  |  ------------------
  ------------------
   48|    490|    RTPP_OBJ_DECREF(pktp);
  ------------------
  |  |  152|    490|#define RTPP_OBJ_DECREF(obj) RC_DECREF((obj)->rcnt)
  |  |  ------------------
  |  |  |  |   67|    490|#define RC_DECREF(rp) CALL_SMETHOD(rp, decref);
  |  |  |  |  ------------------
  |  |  |  |  |  |  134|    490|#define CALL_SMETHOD(obj, method, args...) GET_SMETHODS(obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|    490|#define GET_SMETHODS(obj) _Generic((obj), \
  |  |  |  |  |  |  |  |  108|    490|    struct rtpp_refcnt *: rtpp_refcnt_smethods, \
  |  |  |  |  |  |  |  |  109|    490|    struct rtpp_pearson_perfect *: rtpp_pearson_perfect_smethods, \
  |  |  |  |  |  |  |  |  110|    490|    struct rtpp_netaddr *: rtpp_netaddr_smethods, \
  |  |  |  |  |  |  |  |  111|    490|    struct rtpp_server *: rtpp_server_smethods, \
  |  |  |  |  |  |  |  |  112|    490|    struct rtpp_stats *: rtpp_stats_smethods, \
  |  |  |  |  |  |  |  |  113|    490|    struct rtpp_timed *: rtpp_timed_smethods, \
  |  |  |  |  |  |  |  |  114|    490|    struct rtpp_stream *: rtpp_stream_smethods, \
  |  |  |  |  |  |  |  |  115|    490|    struct rtpp_pcount *: rtpp_pcount_smethods, \
  |  |  |  |  |  |  |  |  116|    490|    struct rtpp_record *: rtpp_record_smethods, \
  |  |  |  |  |  |  |  |  117|    490|    struct rtpp_hash_table *: rtpp_hash_table_smethods, \
  |  |  |  |  |  |  |  |  118|    490|    struct rtpp_weakref *: rtpp_weakref_smethods, \
  |  |  |  |  |  |  |  |  119|    490|    struct rtpp_analyzer *: rtpp_analyzer_smethods, \
  |  |  |  |  |  |  |  |  120|    490|    struct rtpp_pcnt_strm *: rtpp_pcnt_strm_smethods, \
  |  |  |  |  |  |  |  |  121|    490|    struct rtpp_ttl *: rtpp_ttl_smethods, \
  |  |  |  |  |  |  |  |  122|    490|    struct rtpp_pipe *: rtpp_pipe_smethods, \
  |  |  |  |  |  |  |  |  123|    490|    struct rtpp_ringbuf *: rtpp_ringbuf_smethods, \
  |  |  |  |  |  |  |  |  124|    490|    struct rtpp_sessinfo *: rtpp_sessinfo_smethods, \
  |  |  |  |  |  |  |  |  125|    490|    struct rtpp_rw_lock *: rtpp_rw_lock_smethods, \
  |  |  |  |  |  |  |  |  126|    490|    struct rtpp_proc_servers *: rtpp_proc_servers_smethods, \
  |  |  |  |  |  |  |  |  127|    490|    struct rtpp_proc_wakeup *: rtpp_proc_wakeup_smethods, \
  |  |  |  |  |  |  |  |  128|    490|    struct pproc_manager *: pproc_manager_smethods \
  |  |  |  |  |  |  |  |  129|    490|)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   49|    490|    return (0);
   50|    490|}

rtp_packet_parse_raw:
  282|    490|{
  283|    490|    int padding_size;
  284|    490|    rtp_hdr_ext_t *hdr_ext_ptr;
  285|    490|    rtp_hdr_t *header;
  286|       |
  287|    490|    header = (rtp_hdr_t *)buf;
  288|       |
  289|    490|    padding_size = 0;
  290|       |
  291|    490|    rinfo->data_size = 0;
  292|    490|    rinfo->data_offset = 0;
  293|    490|    rinfo->appendable = 1;
  294|    490|    rinfo->nsamples = RTP_NSAMPLES_UNKNOWN;
  ------------------
  |  |   71|    490|#define RTP_NSAMPLES_UNKNOWN  (-1)
  ------------------
  295|       |
  296|    490|    if (size < sizeof(*header))
  ------------------
  |  Branch (296:9): [True: 8, False: 482]
  ------------------
  297|      8|        return RTP_PARSER_PTOOSHRT;
  298|       |
  299|    482|    if (header->version != 2)
  ------------------
  |  Branch (299:9): [True: 4, False: 478]
  ------------------
  300|      4|        return RTP_PARSER_IHDRVER;
  301|       |
  302|    478|    rinfo->data_offset = RTP_HDR_LEN(header);
  ------------------
  |  |  136|    478|#define	RTP_HDR_LEN(rhp)	(sizeof(*(rhp)) + ((rhp)->cc * sizeof((rhp)->csrc[0])))
  ------------------
  303|       |
  304|    478|    if (header->x != 0) {
  ------------------
  |  Branch (304:9): [True: 57, False: 421]
  ------------------
  305|     57|        if (size < rinfo->data_offset + sizeof(*hdr_ext_ptr))
  ------------------
  |  Branch (305:13): [True: 9, False: 48]
  ------------------
  306|      9|            return RTP_PARSER_PTOOSHRTXS;
  307|     48|        hdr_ext_ptr = (rtp_hdr_ext_t *)&buf[rinfo->data_offset];
  308|     48|        rinfo->data_offset += sizeof(rtp_hdr_ext_t) +
  309|     48|          (ntohs(hdr_ext_ptr->length) * sizeof(hdr_ext_ptr->extension[0]));
  310|     48|    }
  311|       |
  312|    469|    if (size < rinfo->data_offset)
  ------------------
  |  Branch (312:9): [True: 32, False: 437]
  ------------------
  313|     32|        return RTP_PARSER_PTOOSHRTXH;
  314|       |
  315|    437|    if (header->p != 0) {
  ------------------
  |  Branch (315:9): [True: 47, False: 390]
  ------------------
  316|     47|        if (rinfo->data_offset == size)
  ------------------
  |  Branch (316:13): [True: 1, False: 46]
  ------------------
  317|      1|            return RTP_PARSER_PTOOSHRTPS;
  318|     46|        padding_size = buf[size - 1];
  319|     46|        if (padding_size == 0)
  ------------------
  |  Branch (319:13): [True: 4, False: 42]
  ------------------
  320|      4|            return RTP_PARSER_IPS;
  321|     46|    }
  322|       |
  323|    432|    if (size < rinfo->data_offset + padding_size)
  ------------------
  |  Branch (323:9): [True: 27, False: 405]
  ------------------
  324|     27|        return RTP_PARSER_PTOOSHRTP;
  325|       |
  326|    405|    rinfo->data_size = size - rinfo->data_offset - padding_size;
  327|    405|    rinfo->ts = ntohl(header->ts);
  328|    405|    rinfo->seq = ntohs(header->seq);
  329|    405|    rinfo->ssrc = ntohl(header->ssrc);
  330|    405|    rinfo->rtp_profile = &rtp_profiles[header->pt];
  331|       |
  332|    405|    if (rinfo->data_size == 0)
  ------------------
  |  Branch (332:9): [True: 264, False: 141]
  ------------------
  333|    264|        return RTP_PARSER_OK;
  334|       |
  335|    141|    rinfo->nsamples = rtp_calc_samples(header->pt, rinfo->data_size,
  336|    141|      &buf[rinfo->data_offset]);
  337|       |    /* 
  338|       |     * G.729 comfort noise frame as the last frame causes 
  339|       |     * packet to be non-appendable
  340|       |     */
  341|    141|    if (header->pt == RTP_G729 && (rinfo->data_size % 10) != 0)
  ------------------
  |  Branch (341:9): [True: 7, False: 134]
  |  Branch (341:35): [True: 6, False: 1]
  ------------------
  342|      6|        rinfo->appendable = 0;
  343|    141|    return RTP_PARSER_OK;
  344|    405|}
rtp.c:g723_len:
   68|  1.19k|{
   69|       |
   70|  1.19k|    switch (ch & 3) {
   71|    420|    case 2:
  ------------------
  |  Branch (71:5): [True: 420, False: 776]
  ------------------
   72|       |	/* Silence Insertion Descriptor (SID) frame */
   73|    420|	return 4;
   74|       |
   75|    309|    case 0:
  ------------------
  |  Branch (75:5): [True: 309, False: 887]
  ------------------
   76|       |	/* 6.3 kbit/s frame */
   77|    309|	return 24;
   78|       |
   79|    443|    case 1:
  ------------------
  |  Branch (79:5): [True: 443, False: 753]
  ------------------
   80|       |	/* 5.3 kbit/s frame */
   81|    443|	return 20;
   82|       |
   83|     24|    default:
  ------------------
  |  Branch (83:5): [True: 24, False: 1.17k]
  ------------------
   84|     24|	return RTP_NSAMPLES_UNKNOWN;
  ------------------
  |  |   71|     24|#define RTP_NSAMPLES_UNKNOWN  (-1)
  ------------------
   85|  1.19k|    }
   86|  1.19k|}
rtp.c:rtp_calc_samples:
  104|    141|{
  105|       |
  106|    141|    switch (codec_id) {
  107|     15|	case RTP_PCMU:
  ------------------
  |  Branch (107:2): [True: 15, False: 126]
  ------------------
  108|     18|	case RTP_PCMA:
  ------------------
  |  Branch (108:2): [True: 3, False: 138]
  ------------------
  109|     18|	    return nbytes;
  110|       |
  111|      7|	case RTP_G729:
  ------------------
  |  Branch (111:2): [True: 7, False: 134]
  ------------------
  112|      7|	    return (nbytes / 10) * 80 + (nbytes % 10 == 0 ? 0 : 80);
  ------------------
  |  Branch (112:35): [True: 1, False: 6]
  ------------------
  113|       |
  114|      1|	case RTP_GSM:
  ------------------
  |  Branch (114:2): [True: 1, False: 140]
  ------------------
  115|      1|	    return 160 * (nbytes / 33);
  116|       |
  117|     79|	case RTP_G723:
  ------------------
  |  Branch (117:2): [True: 79, False: 62]
  ------------------
  118|     79|	    return g723_samples(data, nbytes);
  119|       |
  120|      2|	case RTP_G722:
  ------------------
  |  Branch (120:2): [True: 2, False: 139]
  ------------------
  121|      2|	    return nbytes;
  122|       |
  123|     34|	default:
  ------------------
  |  Branch (123:2): [True: 34, False: 107]
  ------------------
  124|     34|	    return RTP_NSAMPLES_UNKNOWN;
  ------------------
  |  |   71|     34|#define RTP_NSAMPLES_UNKNOWN  (-1)
  ------------------
  125|    141|    }
  126|    141|}
rtp.c:g723_samples:
   90|     79|{
   91|     79|    int pos, samples, n;
   92|       |
   93|  1.25k|    for (pos = 0, samples = 0; pos < maxlen; pos += n) {
  ------------------
  |  Branch (93:32): [True: 1.19k, False: 55]
  ------------------
   94|  1.19k|	samples += 240;
   95|  1.19k|	n = g723_len(buf[pos]);
   96|  1.19k|	if (n == RTP_NSAMPLES_UNKNOWN)
  ------------------
  |  |   71|  1.19k|#define RTP_NSAMPLES_UNKNOWN  (-1)
  ------------------
  |  Branch (96:6): [True: 24, False: 1.17k]
  ------------------
   97|     24|	    return RTP_NSAMPLES_UNKNOWN;
  ------------------
  |  |   71|     24|#define RTP_NSAMPLES_UNKNOWN  (-1)
  ------------------
   98|  1.19k|    }
   99|     55|    return samples;
  100|     79|}

rtpp_stats_init:
  211|      1|{
  212|       |
  213|      1|    memset(stat, '\0', sizeof(struct rtpp_session_stat));
  214|      1|    stat->jdata = rtp_analyze_jt_ctor();
  215|      1|    if (stat->jdata == NULL) {
  ------------------
  |  Branch (215:9): [True: 0, False: 1]
  ------------------
  216|      0|        return (-1);
  217|      0|    }
  218|      1|    stat->last.pt = PT_UNKN;
  ------------------
  |  |   41|      1|#define PT_UNKN 128
  ------------------
  219|      1|    return (0);
  220|      1|}
update_rtpp_stats:
  348|    405|{
  349|    405|    uint32_t seq;
  350|    405|    uint16_t idx;
  351|    405|    uint32_t mask;
  352|    405|    const struct rtp_profile *rpp;
  353|    405|    struct rtp_analyze_jdata *jdp;
  354|       |
  355|    405|    rpp = rinfo->rtp_profile;
  356|    405|    jdp = jdata_by_ssrc(stat->jdata, rinfo->ssrc);
  357|    405|    if (jdp == NULL)
  ------------------
  |  Branch (357:9): [True: 0, False: 405]
  ------------------
  358|      0|        return (UPDATE_ERR);
  359|    405|    if (stat->ssrc_changes == 0) {
  ------------------
  |  Branch (359:9): [True: 1, False: 404]
  ------------------
  360|      1|        RTPP_DBG_ASSERT(stat->last.pcount == 0);
  361|      1|        RTPP_DBG_ASSERT(stat->psent == 0);
  362|      1|        RTPP_DBG_ASSERT(stat->precvd == 0);
  363|      1|        stat->last.ssrc.val = rinfo->ssrc;
  364|      1|        stat->last.ssrc.inited = 1;
  365|      1|        stat->last.max_seq = stat->last.min_seq = rinfo->seq;
  366|      1|        stat->last.base_ts = rinfo->ts;
  367|      1|        stat->last.base_rtime = rtime;
  368|      1|        stat->last.pcount = 1;
  369|      1|        stat->ssrc_changes = 1;
  370|      1|        idx = (rinfo->seq % 131072) >> 5;
  371|      1|        stat->last.seen[idx] |= (uint32_t)1 << (rinfo->seq & 31);
  372|      1|        stat->last.seq = rinfo->seq;
  373|      1|        if (rpp->ts_rate > 0) {
  ------------------
  |  Branch (373:13): [True: 0, False: 1]
  ------------------
  374|      0|            update_jitter_stats(jdp, rinfo, rtime, RTP_NORMAL, rlog);
  ------------------
  |  |  110|      0|#define RTP_NORMAL     0
  ------------------
  375|      0|        }
  376|      1|        return (UPDATE_OK);
  377|      1|    }
  378|    404|    RTPP_DBG_ASSERT(stat->last.ssrc.inited == 1);
  379|    404|    if (stat->last.ssrc.val != rinfo->ssrc) {
  ------------------
  |  Branch (379:9): [True: 200, False: 204]
  ------------------
  380|    200|        update_rtpp_totals(stat, stat);
  381|    200|        stat->last.duplicates = 0;
  382|    200|        memset(stat->last.seen, '\0', sizeof(stat->last.seen));
  383|    200|        LOGI_IF_NOT_NULL(rlog, "SSRC changed from " SSRC_FMT "/%d to "
  ------------------
  |  |  106|    200|    if ((log) != NULL) { \
  |  |  ------------------
  |  |  |  Branch (106:9): [True: 200, False: 0]
  |  |  ------------------
  |  |  107|    200|        RTPP_LOG((log), RTPP_LOG_INFO, ## args); \
  |  |  ------------------
  |  |  |  |   57|    200|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    400|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|    200|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  |  |  |  |   58|    200|  __LINE__, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|    200|        RTPP_LOG((log), RTPP_LOG_INFO, ## args); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   45|    200|#define	RTPP_LOG_INFO	LOG_INFO
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   58|    200|  __LINE__, ## args)
  |  |  ------------------
  |  |  108|    200|    }
  ------------------
  384|    200|          SSRC_FMT "/%d", stat->last.ssrc.val, stat->last.seq, rinfo->ssrc,
  385|    200|          rinfo->seq); 
  386|    200|        stat->last.ssrc.val = rinfo->ssrc;
  387|    200|        stat->last.max_seq = stat->last.min_seq = rinfo->seq;
  388|    200|        stat->last.base_ts = rinfo->ts;
  389|    200|        stat->last.base_rtime = rtime;
  390|    200|        stat->last.pcount = 1;
  391|    200|        stat->ssrc_changes += 1;
  392|    200|        if ((stat->psent > 0 || stat->precvd > 0) && rlog != NULL) {
  ------------------
  |  Branch (392:14): [True: 200, False: 0]
  |  Branch (392:33): [True: 0, False: 0]
  |  Branch (392:54): [True: 200, False: 0]
  ------------------
  393|    200|            LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: ssrc_changes=%u, psent=%u, precvd=%u",
  ------------------
  |  |  102|    200|    if ((log) != NULL) { \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 200, False: 0]
  |  |  ------------------
  |  |  103|    200|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  ------------------
  |  |  |  |   57|    200|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    600|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|    200|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  |  |  |  |   58|    200|  __LINE__, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    200|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   44|    200|#define	RTPP_LOG_DBUG	LOG_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  393|    200|            LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: ssrc_changes=%u, psent=%u, precvd=%u",
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   31|    200|#define SSRC_FMT "0x%.8X"
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  394|    200|              rinfo->ssrc, rinfo->seq, stat->ssrc_changes, stat->psent, stat->precvd);
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   58|    200|  __LINE__, ## args)
  |  |  ------------------
  |  |  104|    200|    }
  ------------------
  394|    200|              rinfo->ssrc, rinfo->seq, stat->ssrc_changes, stat->psent, stat->precvd);
  395|    200|        }
  396|    200|        idx = (rinfo->seq % 131072) >> 5;
  397|    200|        stat->last.seen[idx] |= (uint32_t)1 << (rinfo->seq & 31);
  398|    200|        stat->last.seq = rinfo->seq;
  399|    200|        if (rpp->ts_rate > 0) {
  ------------------
  |  Branch (399:13): [True: 138, False: 62]
  ------------------
  400|    138|            update_jitter_stats(jdp, rinfo, rtime, RTP_SSRC_RESET, rlog);
  ------------------
  |  |  112|    138|#define RTP_SSRC_RESET 2
  ------------------
  401|    138|        }
  402|    200|        return (UPDATE_SSRC_CHG);
  403|    200|    }
  404|    204|    seq = rinfo->seq + stat->last.seq_offset;
  405|    204|    if (header->mbt && (seq < stat->last.max_seq && (stat->last.max_seq & 0xffff) != 65535)) {
  ------------------
  |  Branch (405:9): [True: 107, False: 97]
  |  Branch (405:25): [True: 29, False: 78]
  |  Branch (405:53): [True: 20, False: 9]
  ------------------
  406|     20|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: seq reset last->max_seq=%u, seq=%u, m=%u",
  ------------------
  |  |  102|     20|    if ((log) != NULL) { \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 20, False: 0]
  |  |  ------------------
  |  |  103|     20|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  ------------------
  |  |  |  |   57|     20|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|     60|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|     20|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  |  |  |  |   58|     20|  __LINE__, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|     20|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   44|     20|#define	RTPP_LOG_DBUG	LOG_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  406|     20|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: seq reset last->max_seq=%u, seq=%u, m=%u",
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   31|     20|#define SSRC_FMT "0x%.8X"
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  407|     20|          rinfo->ssrc, rinfo->seq, stat->last.max_seq, seq, header->mbt);
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   58|     20|  __LINE__, ## args)
  |  |  ------------------
  |  |  104|     20|    }
  ------------------
  407|     20|          rinfo->ssrc, rinfo->seq, stat->last.max_seq, seq, header->mbt);
  408|       |        /* Seq reset has happened. Treat it as a ssrc change */
  409|     20|        update_rtpp_totals(stat, stat);
  410|     20|        stat->last.duplicates = 0;
  411|     20|        memset(stat->last.seen, '\0', sizeof(stat->last.seen));
  412|     20|        stat->last.max_seq = stat->last.min_seq = seq;
  413|     20|        stat->last.base_ts = rinfo->ts;
  414|     20|        stat->last.base_rtime = rtime;
  415|     20|        stat->last.pcount = 1;
  416|     20|        stat->seq_res_count += 1;
  417|     20|        idx = (seq % 131072) >> 5;
  418|     20|        stat->last.seen[idx] |= (uint32_t)1 << (rinfo->seq & 31);
  419|     20|        stat->last.seq = rinfo->seq;
  420|     20|        if (rpp->ts_rate > 0) {
  ------------------
  |  Branch (420:13): [True: 14, False: 6]
  ------------------
  421|     14|            update_jitter_stats(jdp, rinfo, rtime, RTP_SEQ_RESET, rlog);
  ------------------
  |  |  111|     14|#define RTP_SEQ_RESET  1
  ------------------
  422|     14|        }
  423|     20|        return (UPDATE_OK);
  424|    184|    } else {
  425|    184|        if (rpp->ts_rate > 0) {
  ------------------
  |  Branch (425:13): [True: 137, False: 47]
  ------------------
  426|    137|            if (seq == 0 && (stat->last.max_seq & 0xffff) < 65500) {
  ------------------
  |  Branch (426:17): [True: 0, False: 137]
  |  Branch (426:29): [True: 0, False: 0]
  ------------------
  427|      0|                update_jitter_stats(jdp, rinfo, rtime, RTP_SEQ_RESET, rlog);
  ------------------
  |  |  111|      0|#define RTP_SEQ_RESET  1
  ------------------
  428|    137|            } else {
  429|    137|                update_jitter_stats(jdp, rinfo, rtime, RTP_NORMAL, rlog);
  ------------------
  |  |  110|    137|#define RTP_NORMAL     0
  ------------------
  430|    137|            }
  431|    137|        }
  432|    184|    }
  433|    184|    if (rpp->ts_rate != 0 && ABS(rtime - stat->last.base_rtime -
  ------------------
  |  |   42|    137|#define ABS(x)          ((x) > 0 ? (x) : (-x))
  |  |  ------------------
  |  |  |  Branch (42:26): [True: 0, False: 137]
  |  |  ------------------
  ------------------
  |  Branch (433:9): [True: 137, False: 47]
  |  Branch (433:30): [True: 0, False: 137]
  ------------------
  434|    137|      rtp_ts2dtime(rpp->ts_rate, rinfo->ts - stat->last.base_ts)) > 0.1) {
  435|      0|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: delta rtime=%f, delta ts=%f",
  ------------------
  |  |  102|      0|    if ((log) != NULL) { \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  103|      0|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  ------------------
  |  |  |  |   57|      0|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|      0|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  |  |  |  |   58|      0|  __LINE__, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   44|      0|#define	RTPP_LOG_DBUG	LOG_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  435|      0|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: delta rtime=%f, delta ts=%f",
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   31|      0|#define SSRC_FMT "0x%.8X"
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  436|      0|          rinfo->ssrc, rinfo->seq, rtime - stat->last.base_rtime,
  |  |  |  |  |  |  |  |  437|      0|          rtp_ts2dtime(rpp->ts_rate, rinfo->ts - stat->last.base_ts));
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   58|      0|  __LINE__, ## args)
  |  |  ------------------
  |  |  104|      0|    }
  ------------------
  436|      0|          rinfo->ssrc, rinfo->seq, rtime - stat->last.base_rtime,
  437|      0|          rtp_ts2dtime(rpp->ts_rate, rinfo->ts - stat->last.base_ts));
  438|      0|        stat->last.base_rtime = rtime;
  439|      0|    }
  440|    184|    if (stat->last.max_seq % 65536 < 536 && rinfo->seq > 65000) {
  ------------------
  |  Branch (440:9): [True: 58, False: 126]
  |  Branch (440:45): [True: 23, False: 35]
  ------------------
  441|       |        /* Pre-wrap packet received after a wrap */
  442|     23|        seq -= 65536;
  443|    161|    } else if (stat->last.max_seq > 65000 && seq < stat->last.max_seq - 65000) {
  ------------------
  |  Branch (443:16): [True: 132, False: 29]
  |  Branch (443:46): [True: 14, False: 118]
  ------------------
  444|     14|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: wrap last->max_seq=%u, seq=%u",
  ------------------
  |  |  102|     14|    if ((log) != NULL) { \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 14, False: 0]
  |  |  ------------------
  |  |  103|     14|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  ------------------
  |  |  |  |   57|     14|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|     42|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|     14|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  |  |  |  |   58|     14|  __LINE__, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|     14|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   44|     14|#define	RTPP_LOG_DBUG	LOG_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  444|     14|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: wrap last->max_seq=%u, seq=%u",
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   31|     14|#define SSRC_FMT "0x%.8X"
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  445|     14|          rinfo->ssrc, rinfo->seq, stat->last.max_seq, seq);
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   58|     14|  __LINE__, ## args)
  |  |  ------------------
  |  |  104|     14|    }
  ------------------
  445|     14|          rinfo->ssrc, rinfo->seq, stat->last.max_seq, seq);
  446|       |        /* Wrap up has happened */
  447|     14|        stat->last.seq_offset += 65536;
  448|     14|        seq += 65536;
  449|     14|        if (stat->last.seq_offset % 131072 == 65536) {
  ------------------
  |  Branch (449:13): [True: 7, False: 7]
  ------------------
  450|      7|            memset(stat->last.seen + 2048, '\0', sizeof(stat->last.seen) / 2);
  451|      7|        } else {
  452|      7|            memset(stat->last.seen, '\0', sizeof(stat->last.seen) / 2);
  453|      7|        }
  454|    147|    } else if (seq + 536 < stat->last.max_seq || seq > stat->last.max_seq + 536) {
  ------------------
  |  Branch (454:16): [True: 18, False: 129]
  |  Branch (454:50): [True: 100, False: 29]
  ------------------
  455|    118|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: desync last->max_seq=%u, seq=%u, m=%u",
  ------------------
  |  |  102|    118|    if ((log) != NULL) { \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 118, False: 0]
  |  |  ------------------
  |  |  103|    118|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  ------------------
  |  |  |  |   57|    118|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    354|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|    118|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  |  |  |  |   58|    118|  __LINE__, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    118|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   44|    118|#define	RTPP_LOG_DBUG	LOG_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  455|    118|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: desync last->max_seq=%u, seq=%u, m=%u",
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   31|    118|#define SSRC_FMT "0x%.8X"
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  456|    118|          rinfo->ssrc, rinfo->seq, stat->last.max_seq, seq, header->mbt);
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   58|    118|  __LINE__, ## args)
  |  |  ------------------
  |  |  104|    118|    }
  ------------------
  456|    118|          rinfo->ssrc, rinfo->seq, stat->last.max_seq, seq, header->mbt);
  457|       |        /* Desynchronization has happened. Treat it as a ssrc change */
  458|    118|        update_rtpp_totals(stat, stat);
  459|    118|        stat->last.duplicates = 0;
  460|    118|        memset(stat->last.seen, '\0', sizeof(stat->last.seen));
  461|    118|        stat->last.max_seq = stat->last.min_seq = seq;
  462|    118|        stat->last.pcount = 1;
  463|    118|        stat->desync_count += 1;
  464|    118|        idx = (seq % 131072) >> 5;
  465|    118|        stat->last.seen[idx] |= (uint32_t)1 << (rinfo->seq & 31);
  466|    118|        stat->last.seq = rinfo->seq;
  467|    118|        return (UPDATE_OK);
  468|    118|    }
  469|       |        /* printf("last->max_seq=%u, seq=%u, m=%u\n", stat->last.max_seq, seq, header->mbt);*/
  470|     66|    idx = (seq % 131072) >> 5;
  471|     66|    mask = stat->last.seen[idx];
  472|     66|    if (((mask >> (seq & 31)) & 1) != 0) {
  ------------------
  |  Branch (472:9): [True: 5, False: 61]
  ------------------
  473|      5|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: DUP",
  ------------------
  |  |  102|      5|    if ((log) != NULL) { \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 5, False: 0]
  |  |  ------------------
  |  |  103|      5|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  ------------------
  |  |  |  |   57|      5|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|     15|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|      5|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  |  |  |  |   58|      5|  __LINE__, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      5|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   44|      5|#define	RTPP_LOG_DBUG	LOG_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  473|      5|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: DUP",
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   31|      5|#define SSRC_FMT "0x%.8X"
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  474|      5|          rinfo->ssrc, rinfo->seq);
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   58|      5|  __LINE__, ## args)
  |  |  ------------------
  |  |  104|      5|    }
  ------------------
  474|      5|          rinfo->ssrc, rinfo->seq);
  475|      5|        stat->last.duplicates += 1;
  476|      5|        stat->last.seq = rinfo->seq;
  477|      5|        return (UPDATE_OK);
  478|      5|    }
  479|     61|    stat->last.seen[idx] |= (uint32_t)1 << (rinfo->seq & 31);
  480|     61|    if (seq - stat->last.max_seq != 1)
  ------------------
  |  Branch (480:9): [True: 59, False: 2]
  ------------------
  481|     59|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: delta = %d",
  ------------------
  |  |  102|     59|    if ((log) != NULL) { \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 59, False: 0]
  |  |  ------------------
  |  |  103|     59|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  ------------------
  |  |  |  |   57|     59|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|    177|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|     59|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  |  |  |  |   58|     59|  __LINE__, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|     59|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   44|     59|#define	RTPP_LOG_DBUG	LOG_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  481|     59|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: delta = %d",
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   31|     59|#define SSRC_FMT "0x%.8X"
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  482|     59|          rinfo->ssrc, rinfo->seq, seq - stat->last.max_seq);
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   58|     59|  __LINE__, ## args)
  |  |  ------------------
  |  |  104|     59|    }
  ------------------
  482|     61|          rinfo->ssrc, rinfo->seq, seq - stat->last.max_seq);
  483|     61|    if (seq >= stat->last.max_seq) {
  ------------------
  |  Branch (483:9): [True: 34, False: 27]
  ------------------
  484|     34|        stat->last.max_seq = seq;
  485|     34|        stat->last.pcount += 1;
  486|     34|        stat->last.seq = rinfo->seq;
  487|     34|        return (UPDATE_OK);
  488|     34|    }
  489|     27|    if (seq >= stat->last.min_seq) {
  ------------------
  |  Branch (489:9): [True: 8, False: 19]
  ------------------
  490|      8|        stat->last.pcount += 1;
  491|      8|        stat->last.seq = rinfo->seq;
  492|      8|        return (UPDATE_OK);
  493|      8|    }
  494|     19|    if (stat->last.seq_offset == 0 && seq < stat->last.min_seq) {
  ------------------
  |  Branch (494:9): [True: 0, False: 19]
  |  Branch (494:39): [True: 0, False: 0]
  ------------------
  495|      0|        stat->last.min_seq = seq;
  496|      0|        stat->last.pcount += 1;
  497|      0|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: last->min_seq=%u",
  ------------------
  |  |  102|      0|    if ((log) != NULL) { \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  103|      0|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  ------------------
  |  |  |  |   57|      0|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|      0|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  |  |  |  |   58|      0|  __LINE__, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   44|      0|#define	RTPP_LOG_DBUG	LOG_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  497|      0|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT "/%d: last->min_seq=%u",
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   31|      0|#define SSRC_FMT "0x%.8X"
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  498|      0|          rinfo->ssrc, rinfo->seq, stat->last.min_seq);
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   58|      0|  __LINE__, ## args)
  |  |  ------------------
  |  |  104|      0|    }
  ------------------
  498|      0|          rinfo->ssrc, rinfo->seq, stat->last.min_seq);
  499|      0|        stat->last.seq = rinfo->seq;
  500|      0|        return (UPDATE_OK);
  501|      0|    }
  502|       |    /* XXX something wrong with the stream */
  503|     19|    stat->last.seq = rinfo->seq;
  504|     19|    return (UPDATE_ERR);
  505|     19|}
update_rtpp_totals:
  509|    338|{
  510|       |
  511|    338|    if (ostat != wstat) {
  ------------------
  |  Branch (511:9): [True: 0, False: 338]
  ------------------
  512|      0|        ostat->psent = wstat->psent;
  513|      0|        ostat->precvd = wstat->precvd;
  514|      0|        ostat->duplicates = wstat->duplicates;
  515|      0|    }
  516|    338|    if (wstat->last.pcount == 0)
  ------------------
  |  Branch (516:9): [True: 0, False: 338]
  ------------------
  517|      0|        return;
  518|    338|    ostat->psent += wstat->last.max_seq - wstat->last.min_seq + 1;
  519|    338|    ostat->precvd += wstat->last.pcount;
  520|    338|    ostat->duplicates += wstat->last.duplicates;
  521|    338|}
rtp_analyze.c:rtp_analyze_jt_ctor:
  245|      1|{
  246|      1|    struct rtp_analyze_jitter *jp;
  247|       |
  248|      1|    jp = rtpp_zmalloc(sizeof(*jp));
  249|      1|    if (jp == NULL) {
  ------------------
  |  Branch (249:9): [True: 0, False: 1]
  ------------------
  250|      0|        goto e0;
  251|      0|    }
  252|      1|    jp->first = rtp_analyze_jdata_ctor();
  253|      1|    if (jp->first == NULL) {
  ------------------
  |  Branch (253:9): [True: 0, False: 1]
  ------------------
  254|      0|        goto e1;
  255|      0|    }
  256|      1|    jp->jdlen = 1;
  257|      1|    return (jp);
  258|       |
  259|      0|e1:
  260|      0|    free(jp);
  261|      0|e0:
  262|      0|    return (NULL);
  263|      0|}
rtp_analyze.c:rtp_analyze_jdata_ctor:
  224|     10|{
  225|     10|    struct rtp_analyze_jdata *jdp;
  226|       |
  227|     10|    jdp = rtpp_zmalloc(sizeof(*jdp));
  228|     10|    if (jdp == NULL) {
  ------------------
  |  Branch (228:9): [True: 0, False: 10]
  ------------------
  229|      0|        goto e0;
  230|      0|    }
  231|     10|    jdp->ts_dedup = rtpp_ringbuf_ctor(sizeof(jdp->jss.prev_ts), 10);
  232|     10|    if (jdp->ts_dedup == NULL) {
  ------------------
  |  Branch (232:9): [True: 0, False: 10]
  ------------------
  233|      0|        goto e1;
  234|      0|    }
  235|     10|    return (jdp);
  236|       |
  237|      0|e1:
  238|      0|    free(jdp);
  239|      0|e0:
  240|      0|    return (NULL);
  241|      0|}
rtp_analyze.c:jdata_by_ssrc:
  292|    405|{
  293|    405|    struct rtp_analyze_jdata *rjdp, *jdp_last, *jdp_prelast;
  294|       |
  295|    405|    if (jp->first->ssrc.inited == 0) {
  ------------------
  |  Branch (295:9): [True: 1, False: 404]
  ------------------
  296|      1|        jp->first->ssrc.val = ssrc;
  297|      1|        jp->first->ssrc.inited = 1;
  298|      1|        return (jp->first);
  299|      1|    }
  300|       |
  301|    404|    jdp_last = jdp_prelast = NULL;
  302|  2.74k|    for (rjdp = jp->first; rjdp != NULL; rjdp = rjdp->next) {
  ------------------
  |  Branch (302:28): [True: 2.61k, False: 124]
  ------------------
  303|  2.61k|        if (rjdp->ssrc.val == ssrc) {
  ------------------
  |  Branch (303:13): [True: 280, False: 2.33k]
  ------------------
  304|    280|            return (rjdp);
  305|    280|        }
  306|  2.33k|        jdp_prelast = jdp_last;
  307|  2.33k|        jdp_last = rjdp;
  308|  2.33k|    }
  309|       |
  310|    124|    if (jp->jdlen == RTPC_JDATA_MAX) {
  ------------------
  |  |  114|    124|#define RTPC_JDATA_MAX 10
  ------------------
  |  Branch (310:9): [True: 115, False: 9]
  ------------------
  311|       |        /* Re-use the last per-ssrc data */
  312|    115|        rjdp = jdp_last;
  313|    115|        if (jdp_prelast != NULL) {
  ------------------
  |  Branch (313:13): [True: 115, False: 0]
  ------------------
  314|    115|            RTPP_DBG_ASSERT(jdp_prelast->next == jdp_last);
  315|    115|            jdp_prelast->next = NULL;
  316|    115|        } else {
  317|      0|            jp->first = NULL;
  318|      0|        }
  319|    115|        CALL_SMETHOD(rjdp->ts_dedup, flush);
  ------------------
  |  |  134|    115|#define CALL_SMETHOD(obj, method, args...) GET_SMETHODS(obj)->method(obj, ## args)
  |  |  ------------------
  |  |  |  |  107|    115|#define GET_SMETHODS(obj) _Generic((obj), \
  |  |  |  |  108|    115|    struct rtpp_refcnt *: rtpp_refcnt_smethods, \
  |  |  |  |  109|    115|    struct rtpp_pearson_perfect *: rtpp_pearson_perfect_smethods, \
  |  |  |  |  110|    115|    struct rtpp_netaddr *: rtpp_netaddr_smethods, \
  |  |  |  |  111|    115|    struct rtpp_server *: rtpp_server_smethods, \
  |  |  |  |  112|    115|    struct rtpp_stats *: rtpp_stats_smethods, \
  |  |  |  |  113|    115|    struct rtpp_timed *: rtpp_timed_smethods, \
  |  |  |  |  114|    115|    struct rtpp_stream *: rtpp_stream_smethods, \
  |  |  |  |  115|    115|    struct rtpp_pcount *: rtpp_pcount_smethods, \
  |  |  |  |  116|    115|    struct rtpp_record *: rtpp_record_smethods, \
  |  |  |  |  117|    115|    struct rtpp_hash_table *: rtpp_hash_table_smethods, \
  |  |  |  |  118|    115|    struct rtpp_weakref *: rtpp_weakref_smethods, \
  |  |  |  |  119|    115|    struct rtpp_analyzer *: rtpp_analyzer_smethods, \
  |  |  |  |  120|    115|    struct rtpp_pcnt_strm *: rtpp_pcnt_strm_smethods, \
  |  |  |  |  121|    115|    struct rtpp_ttl *: rtpp_ttl_smethods, \
  |  |  |  |  122|    115|    struct rtpp_pipe *: rtpp_pipe_smethods, \
  |  |  |  |  123|    115|    struct rtpp_ringbuf *: rtpp_ringbuf_smethods, \
  |  |  |  |  124|    115|    struct rtpp_sessinfo *: rtpp_sessinfo_smethods, \
  |  |  |  |  125|    115|    struct rtpp_rw_lock *: rtpp_rw_lock_smethods, \
  |  |  |  |  126|    115|    struct rtpp_proc_servers *: rtpp_proc_servers_smethods, \
  |  |  |  |  127|    115|    struct rtpp_proc_wakeup *: rtpp_proc_wakeup_smethods, \
  |  |  |  |  128|    115|    struct pproc_manager *: pproc_manager_smethods \
  |  |  |  |  129|    115|)
  |  |  ------------------
  ------------------
  320|    115|        if (rjdp->jss.pcount >= 2) {
  ------------------
  |  Branch (320:13): [True: 12, False: 103]
  ------------------
  321|     12|            if (jp->jmax_acum < rjdp->jss.jmax) {
  ------------------
  |  Branch (321:17): [True: 0, False: 12]
  ------------------
  322|      0|                jp->jmax_acum = rjdp->jss.jmax;
  323|      0|            }
  324|     12|            jp->jtotal_acum += rjdp->jss.jtotal;
  325|     12|            jp->jvcount_acum += rjdp->jss.pcount - 1;
  326|     12|            jp->pcount_acum += rjdp->jss.pcount;
  327|     12|        }
  328|    115|        memset(&rjdp->jss, '\0', sizeof(rjdp->jss));
  329|    115|        RTPP_DBG_ASSERT(rjdp->ssrc.inited == 1);
  330|    115|    } else {
  331|       |        /* Allocate per-ssrc data */
  332|      9|        rjdp = rtp_analyze_jdata_ctor();
  333|      9|        if (rjdp == NULL) {
  ------------------
  |  Branch (333:13): [True: 0, False: 9]
  ------------------
  334|      0|            return (NULL);
  335|      0|        }
  336|      9|        rjdp->ssrc.inited = 1;
  337|      9|        jp->jdlen += 1;
  338|      9|    }
  339|    124|    rjdp->ssrc.val = ssrc;
  340|    124|    rjdp->next = jp->first;
  341|    124|    jp->first = rjdp;
  342|    124|    return (rjdp);
  343|    124|}
rtp_analyze.c:update_jitter_stats:
  119|    289|{
  120|    289|    int64_t dval;
  121|    289|    uint64_t rtime_ts, wrcorr;
  122|    289|#if FIX_TIMESTAMP_RESET
  123|    289|    int64_t rtime_ts_delta;
  124|    289|#endif
  125|       |
  126|    289|    rtime_ts = rtp_dtime2time_ts64(rinfo->rtp_profile->ts_rate, rtime);
  127|    289|    if (rinfo->rtp_profile->pt_kind == RTP_PTK_AUDIO &&
  ------------------
  |  Branch (127:9): [True: 289, False: 0]
  ------------------
  128|    289|      CALL_SMETHOD(jdp->ts_dedup, locate, &rinfo->ts) >= 0) {
  ------------------
  |  |  134|    289|#define CALL_SMETHOD(obj, method, args...) GET_SMETHODS(obj)->method(obj, ## args)
  |  |  ------------------
  |  |  |  |  107|    289|#define GET_SMETHODS(obj) _Generic((obj), \
  |  |  |  |  108|    289|    struct rtpp_refcnt *: rtpp_refcnt_smethods, \
  |  |  |  |  109|    289|    struct rtpp_pearson_perfect *: rtpp_pearson_perfect_smethods, \
  |  |  |  |  110|    289|    struct rtpp_netaddr *: rtpp_netaddr_smethods, \
  |  |  |  |  111|    289|    struct rtpp_server *: rtpp_server_smethods, \
  |  |  |  |  112|    289|    struct rtpp_stats *: rtpp_stats_smethods, \
  |  |  |  |  113|    289|    struct rtpp_timed *: rtpp_timed_smethods, \
  |  |  |  |  114|    289|    struct rtpp_stream *: rtpp_stream_smethods, \
  |  |  |  |  115|    289|    struct rtpp_pcount *: rtpp_pcount_smethods, \
  |  |  |  |  116|    289|    struct rtpp_record *: rtpp_record_smethods, \
  |  |  |  |  117|    289|    struct rtpp_hash_table *: rtpp_hash_table_smethods, \
  |  |  |  |  118|    289|    struct rtpp_weakref *: rtpp_weakref_smethods, \
  |  |  |  |  119|    289|    struct rtpp_analyzer *: rtpp_analyzer_smethods, \
  |  |  |  |  120|    289|    struct rtpp_pcnt_strm *: rtpp_pcnt_strm_smethods, \
  |  |  |  |  121|    289|    struct rtpp_ttl *: rtpp_ttl_smethods, \
  |  |  |  |  122|    289|    struct rtpp_pipe *: rtpp_pipe_smethods, \
  |  |  |  |  123|    289|    struct rtpp_ringbuf *: rtpp_ringbuf_smethods, \
  |  |  |  |  124|    289|    struct rtpp_sessinfo *: rtpp_sessinfo_smethods, \
  |  |  |  |  125|    289|    struct rtpp_rw_lock *: rtpp_rw_lock_smethods, \
  |  |  |  |  126|    289|    struct rtpp_proc_servers *: rtpp_proc_servers_smethods, \
  |  |  |  |  127|    289|    struct rtpp_proc_wakeup *: rtpp_proc_wakeup_smethods, \
  |  |  |  |  128|    289|    struct pproc_manager *: pproc_manager_smethods \
  |  |  |  |  129|    289|)
  |  |  ------------------
  ------------------
  |  Branch (128:7): [True: 31, False: 258]
  ------------------
  129|     31|        jdp->jss.ts_dcount++;
  130|     31|        if (jdp->jss.pcount == 1) {
  ------------------
  |  Branch (130:13): [True: 1, False: 30]
  ------------------
  131|      1|            jdp->jss.prev_rtime_ts = rtime_ts;
  132|      1|            jdp->jss.prev_ts = rinfo->ts;
  133|      1|        }
  134|     31|        return;
  135|     31|    }
  136|    258|    if (jdp->jss.prev_rtime_ts != 0) {
  ------------------
  |  Branch (136:9): [True: 0, False: 258]
  ------------------
  137|      0|        if (hint == RTP_SEQ_RESET) {
  ------------------
  |  |  111|      0|#define RTP_SEQ_RESET  1
  ------------------
  |  Branch (137:13): [True: 0, False: 0]
  ------------------
  138|      0|            jdp->jss.seq_rcount++;
  139|      0|            goto saveandexit;
  140|      0|        }
  141|      0|#if FIX_TIMESTAMP_RESET
  142|      0|        rtime_ts_delta = jdp->jss.prev_rtime_ts - rtime_ts;
  143|      0|#endif
  144|      0|        if (jdp->jss.prev_ts > rinfo->ts) {
  ------------------
  |  Branch (144:13): [True: 0, False: 0]
  ------------------
  145|      0|            if (((uint64_t)jdp->jss.prev_ts - (uint64_t)rinfo->ts) > ((uint32_t)1 << 31)) {
  ------------------
  |  Branch (145:17): [True: 0, False: 0]
  ------------------
  146|       |                /* Normal case, timestamp wrap */
  147|      0|                wrcorr = (uint64_t)1 << 32;
  148|      0|#if FIX_TIMESTAMP_RESET
  149|      0|            } else if (rtime_ts_delta != 0 && ((uint64_t)jdp->jss.prev_ts - (uint64_t)rinfo->ts) >
  ------------------
  |  Branch (149:24): [True: 0, False: 0]
  |  Branch (149:47): [True: 0, False: 0]
  ------------------
  150|      0|              ABS(rtime_ts_delta) * 50) {
  ------------------
  |  |   42|      0|#define ABS(x)          ((x) > 0 ? (x) : (-x))
  |  |  ------------------
  |  |  |  Branch (42:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  151|       |                /* Timestamp reset */
  152|      0|#if DEBUG_TIMESTAMP_RESET
  153|      0|                LOGD_IF_NOT_NULL(rlog, "update_jitter_stats() : timestamp reset : " SSRC_FMT ", %lld, %llu",
  ------------------
  |  |  102|      0|    if ((log) != NULL) { \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  103|      0|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  ------------------
  |  |  |  |   57|      0|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|      0|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  |  |  |  |   58|      0|  __LINE__, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   44|      0|#define	RTPP_LOG_DBUG	LOG_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  153|      0|                LOGD_IF_NOT_NULL(rlog, "update_jitter_stats() : timestamp reset : " SSRC_FMT ", %lld, %llu",
  |  |  |  |  |  |  |  |  154|      0|                  rinfo->ssrc, T_printf(ABS(rtime_ts_delta)),
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   39|      0|#define T_printf(val) _Generic((val), \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (39:33): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|      0|    uint64_t: (unsigned long long)(val), \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (40:36): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|      0|    int64_t: (long long)(val) \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (41:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   42|      0|)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|      0|                  T_printf((uint64_t)jdp->jss.prev_ts - (uint64_t)rinfo->ts));
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   39|      0|#define T_printf(val) _Generic((val), \
  |  |  |  |  |  |  |  |  |  |   40|      0|    uint64_t: (unsigned long long)(val), \
  |  |  |  |  |  |  |  |  |  |   41|      0|    int64_t: (long long)(val) \
  |  |  |  |  |  |  |  |  |  |   42|      0|)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   58|      0|  __LINE__, ## args)
  |  |  ------------------
  |  |  104|      0|    }
  ------------------
  154|      0|                  rinfo->ssrc, T_printf(ABS(rtime_ts_delta)),
  155|      0|                  T_printf((uint64_t)jdp->jss.prev_ts - (uint64_t)rinfo->ts));
  156|      0|#endif
  157|      0|                jdp->jss.ts_rcount++;
  158|      0|                goto saveandexit;
  159|      0|#endif
  160|      0|            } else {
  161|      0|                wrcorr = 0;
  162|      0|            }
  163|      0|        } else {
  164|      0|# if FIX_TIMESTAMP_RESET
  165|      0|            if (rtime_ts_delta != 0 && ((uint64_t)rinfo->ts - (uint64_t)jdp->jss.prev_ts) >
  ------------------
  |  Branch (165:17): [True: 0, False: 0]
  |  Branch (165:40): [True: 0, False: 0]
  ------------------
  166|      0|              ABS(rtime_ts_delta) * 1024) {
  ------------------
  |  |   42|      0|#define ABS(x)          ((x) > 0 ? (x) : (-x))
  |  |  ------------------
  |  |  |  Branch (42:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  167|       |                /* Timestamp jump */
  168|      0|#if DEBUG_TIMESTAMP_RESET
  169|      0|                LOGD_IF_NOT_NULL(rlog,"update_jitter_stats() : timestamp jump : " SSRC_FMT ", %lld, %lld",
  ------------------
  |  |  102|      0|    if ((log) != NULL) { \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  103|      0|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  ------------------
  |  |  |  |   57|      0|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   44|      0|#define	RTPP_LOG_DBUG	LOG_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  169|      0|                LOGD_IF_NOT_NULL(rlog,"update_jitter_stats() : timestamp jump : " SSRC_FMT ", %lld, %lld",
  |  |  |  |  |  |  |  |  170|      0|                  rinfo->ssrc, T_printf(ABS(rtime_ts_delta)),
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   39|      0|#define T_printf(val) _Generic((val), \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (39:33): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|      0|    uint64_t: (unsigned long long)(val), \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (40:36): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|      0|    int64_t: (long long)(val) \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (41:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   42|      0|)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  171|      0|                  T_printf((uint64_t)rinfo->ts - (uint64_t)jdp->jss.prev_ts));
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   39|      0|#define T_printf(val) _Generic((val), \
  |  |  |  |  |  |  |  |  |  |   40|      0|    uint64_t: (unsigned long long)(val), \
  |  |  |  |  |  |  |  |  |  |   41|      0|    int64_t: (long long)(val) \
  |  |  |  |  |  |  |  |  |  |   42|      0|)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|      0|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  |  |  |  |   58|      0|  __LINE__, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   58|      0|  __LINE__, ## args)
  |  |  ------------------
  |  |  104|      0|    }
  ------------------
  170|      0|                  rinfo->ssrc, T_printf(ABS(rtime_ts_delta)),
  171|      0|                  T_printf((uint64_t)rinfo->ts - (uint64_t)jdp->jss.prev_ts));
  172|      0|#endif
  173|      0|                jdp->jss.ts_jcount++;
  174|      0|                goto saveandexit;
  175|      0|            }
  176|      0|#endif
  177|      0|            wrcorr = 0;
  178|      0|        }
  179|      0|        dval = (rtime_ts - ((uint64_t)rinfo->ts + wrcorr)) -
  180|      0|          (jdp->jss.prev_rtime_ts - (uint64_t)jdp->jss.prev_ts);
  181|      0|#if DEBUG_TIMESTAMP_RESET
  182|      0|        if (dval > 10000)
  ------------------
  |  Branch (182:13): [True: 0, False: 0]
  ------------------
  183|      0|            LOGD_IF_NOT_NULL(rlog, "##### LARGE VALUE #####" SSRC_FMT ",%lld,%llu,%u,%llu,%u,%llu,%lld",
  ------------------
  |  |  102|      0|    if ((log) != NULL) { \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  103|      0|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  ------------------
  |  |  |  |   57|      0|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|      0|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  |  |  |  |   58|      0|  __LINE__, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   44|      0|#define	RTPP_LOG_DBUG	LOG_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|      0|            LOGD_IF_NOT_NULL(rlog, "##### LARGE VALUE #####" SSRC_FMT ",%lld,%llu,%u,%llu,%u,%llu,%lld",
  |  |  |  |  |  |  |  |  184|      0|              rinfo->ssrc, jdp->jss.pcount, T_printf(rtime_ts), rinfo->ts,
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   39|      0|#define T_printf(val) _Generic((val), \
  |  |  |  |  |  |  |  |  |  |   40|      0|    uint64_t: (unsigned long long)(val), \
  |  |  |  |  |  |  |  |  |  |   41|      0|    int64_t: (long long)(val) \
  |  |  |  |  |  |  |  |  |  |   42|      0|)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  185|      0|              T_printf(jdp->jss.prev_rtime_ts), jdp->jss.prev_ts,
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   39|      0|#define T_printf(val) _Generic((val), \
  |  |  |  |  |  |  |  |  |  |   40|      0|    uint64_t: (unsigned long long)(val), \
  |  |  |  |  |  |  |  |  |  |   41|      0|    int64_t: (long long)(val) \
  |  |  |  |  |  |  |  |  |  |   42|      0|)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|      0|              T_printf(wrcorr), T_printf(dval));
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   39|      0|#define T_printf(val) _Generic((val), \
  |  |  |  |  |  |  |  |  |  |   40|      0|    uint64_t: (unsigned long long)(val), \
  |  |  |  |  |  |  |  |  |  |   41|      0|    int64_t: (long long)(val) \
  |  |  |  |  |  |  |  |  |  |   42|      0|)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |                             T_printf(wrcorr), T_printf(dval));
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   39|      0|#define T_printf(val) _Generic((val), \
  |  |  |  |  |  |  |  |  |  |   40|      0|    uint64_t: (unsigned long long)(val), \
  |  |  |  |  |  |  |  |  |  |   41|      0|    int64_t: (long long)(val) \
  |  |  |  |  |  |  |  |  |  |   42|      0|)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   58|      0|  __LINE__, ## args)
  |  |  ------------------
  |  |  104|      0|    }
  ------------------
  184|      0|              rinfo->ssrc, jdp->jss.pcount, T_printf(rtime_ts), rinfo->ts,
  185|      0|              T_printf(jdp->jss.prev_rtime_ts), jdp->jss.prev_ts,
  186|      0|              T_printf(wrcorr), T_printf(dval));
  187|      0|#endif
  188|      0|        jdp->jss.jlast = jdp->jss.jlast + (double)(ABS(dval) - jdp->jss.jlast) / 16.0;
  ------------------
  |  |   42|      0|#define ABS(x)          ((x) > 0 ? (x) : (-x))
  |  |  ------------------
  |  |  |  Branch (42:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  189|      0|        if (jdp->jss.jlast > jdp->jss.jmax) {
  ------------------
  |  Branch (189:13): [True: 0, False: 0]
  ------------------
  190|      0|            jdp->jss.jmax = jdp->jss.jlast;
  191|      0|        }
  192|      0|        jdp->jss.jtotal += jdp->jss.jlast;
  193|      0|    }
  194|    258|    RTPP_DBGCODE(analyze > 1) {
  ------------------
  |  |   84|    258|#define RTPP_DBGCODE(x) if (_DCOND_##x)
  |  |  ------------------
  |  |  |  Branch (84:29): [Folded - Ignored]
  |  |  ------------------
  ------------------
  195|      0|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT ",%lld,%llu,%u,%f", rinfo->ssrc, jdp->jss.pcount,
  ------------------
  |  |  102|      0|    if ((log) != NULL) { \
  |  |  ------------------
  |  |  |  Branch (102:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  103|      0|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  ------------------
  |  |  |  |   57|      0|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|      0|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   57|      0|#define RTPP_LOG(log, args...) CALL_METHOD((log), genwrite, __FUNCTION__, \
  |  |  |  |  |  |  |  |   58|      0|  __LINE__, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|        RTPP_LOG((log), RTPP_LOG_DBUG, ## args); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   44|      0|#define	RTPP_LOG_DBUG	LOG_DEBUG
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  195|      0|        LOGD_IF_NOT_NULL(rlog, SSRC_FMT ",%lld,%llu,%u,%f", rinfo->ssrc, jdp->jss.pcount,
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   31|      0|#define SSRC_FMT "0x%.8X"
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  196|      0|          T_printf(rtime_ts), rinfo->ts, jdp->jss.jlast);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   39|      0|#define T_printf(val) _Generic((val), \
  |  |  |  |  |  |  |  |  |  |   40|      0|    uint64_t: (unsigned long long)(val), \
  |  |  |  |  |  |  |  |  |  |   41|      0|    int64_t: (long long)(val) \
  |  |  |  |  |  |  |  |  |  |   42|      0|)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   58|      0|  __LINE__, ## args)
  |  |  ------------------
  |  |  104|      0|    }
  ------------------
  196|      0|          T_printf(rtime_ts), rinfo->ts, jdp->jss.jlast);
  197|      0|    }
  198|    258|    jdp->jss.pcount++;
  199|    258|saveandexit:
  200|    258|    if (rinfo->rtp_profile->pt_kind == RTP_PTK_AUDIO) {
  ------------------
  |  Branch (200:9): [True: 258, False: 0]
  ------------------
  201|    258|        CALL_SMETHOD(jdp->ts_dedup, push, &rinfo->ts);
  ------------------
  |  |  134|    258|#define CALL_SMETHOD(obj, method, args...) GET_SMETHODS(obj)->method(obj, ## args)
  |  |  ------------------
  |  |  |  |  107|    258|#define GET_SMETHODS(obj) _Generic((obj), \
  |  |  |  |  108|    258|    struct rtpp_refcnt *: rtpp_refcnt_smethods, \
  |  |  |  |  109|    258|    struct rtpp_pearson_perfect *: rtpp_pearson_perfect_smethods, \
  |  |  |  |  110|    258|    struct rtpp_netaddr *: rtpp_netaddr_smethods, \
  |  |  |  |  111|    258|    struct rtpp_server *: rtpp_server_smethods, \
  |  |  |  |  112|    258|    struct rtpp_stats *: rtpp_stats_smethods, \
  |  |  |  |  113|    258|    struct rtpp_timed *: rtpp_timed_smethods, \
  |  |  |  |  114|    258|    struct rtpp_stream *: rtpp_stream_smethods, \
  |  |  |  |  115|    258|    struct rtpp_pcount *: rtpp_pcount_smethods, \
  |  |  |  |  116|    258|    struct rtpp_record *: rtpp_record_smethods, \
  |  |  |  |  117|    258|    struct rtpp_hash_table *: rtpp_hash_table_smethods, \
  |  |  |  |  118|    258|    struct rtpp_weakref *: rtpp_weakref_smethods, \
  |  |  |  |  119|    258|    struct rtpp_analyzer *: rtpp_analyzer_smethods, \
  |  |  |  |  120|    258|    struct rtpp_pcnt_strm *: rtpp_pcnt_strm_smethods, \
  |  |  |  |  121|    258|    struct rtpp_ttl *: rtpp_ttl_smethods, \
  |  |  |  |  122|    258|    struct rtpp_pipe *: rtpp_pipe_smethods, \
  |  |  |  |  123|    258|    struct rtpp_ringbuf *: rtpp_ringbuf_smethods, \
  |  |  |  |  124|    258|    struct rtpp_sessinfo *: rtpp_sessinfo_smethods, \
  |  |  |  |  125|    258|    struct rtpp_rw_lock *: rtpp_rw_lock_smethods, \
  |  |  |  |  126|    258|    struct rtpp_proc_servers *: rtpp_proc_servers_smethods, \
  |  |  |  |  127|    258|    struct rtpp_proc_wakeup *: rtpp_proc_wakeup_smethods, \
  |  |  |  |  128|    258|    struct pproc_manager *: pproc_manager_smethods \
  |  |  |  |  129|    258|)
  |  |  ------------------
  ------------------
  202|    258|    }
  203|    258|    jdp->jss.prev_rtime_ts = rtime_ts;
  204|    258|    jdp->jss.prev_ts = rinfo->ts;
  205|    258|}
rtp_analyze.c:rtp_dtime2time_ts64:
   95|    289|{
   96|       |
   97|    289|    return (uint64_t)(dtime * (double)ts_rate);
   98|    289|}
rtp_analyze.c:rtp_ts2dtime:
   88|    274|{
   89|       |
   90|    274|    return ((double)ts) / ((double)ts_rate);
   91|    274|}

rtp_packet_alloc:
   87|    490|{
   88|    490|    struct rtp_packet_full *pkt;
   89|       |
   90|    490|    pkt = rtpp_rzmalloc(sizeof(*pkt), PVT_RCOFFS(pkt));
  ------------------
  |  |  144|    490|#define PVT_RCOFFS(pvtp) (offsetof(typeof(*(pvtp)), pub) + offsetof(typeof((pvtp)->pub), rcnt))
  ------------------
   91|    490|    if (pkt == NULL) {
  ------------------
  |  Branch (91:9): [True: 0, False: 490]
  ------------------
   92|      0|        return (NULL);
   93|      0|    }
   94|    490|    CALL_SMETHOD(pkt->pub.rcnt, use_stdfree, pkt);
  ------------------
  |  |  134|    490|#define CALL_SMETHOD(obj, method, args...) GET_SMETHODS(obj)->method(obj, ## args)
  |  |  ------------------
  |  |  |  |  107|    490|#define GET_SMETHODS(obj) _Generic((obj), \
  |  |  |  |  108|    490|    struct rtpp_refcnt *: rtpp_refcnt_smethods, \
  |  |  |  |  109|    490|    struct rtpp_pearson_perfect *: rtpp_pearson_perfect_smethods, \
  |  |  |  |  110|    490|    struct rtpp_netaddr *: rtpp_netaddr_smethods, \
  |  |  |  |  111|    490|    struct rtpp_server *: rtpp_server_smethods, \
  |  |  |  |  112|    490|    struct rtpp_stats *: rtpp_stats_smethods, \
  |  |  |  |  113|    490|    struct rtpp_timed *: rtpp_timed_smethods, \
  |  |  |  |  114|    490|    struct rtpp_stream *: rtpp_stream_smethods, \
  |  |  |  |  115|    490|    struct rtpp_pcount *: rtpp_pcount_smethods, \
  |  |  |  |  116|    490|    struct rtpp_record *: rtpp_record_smethods, \
  |  |  |  |  117|    490|    struct rtpp_hash_table *: rtpp_hash_table_smethods, \
  |  |  |  |  118|    490|    struct rtpp_weakref *: rtpp_weakref_smethods, \
  |  |  |  |  119|    490|    struct rtpp_analyzer *: rtpp_analyzer_smethods, \
  |  |  |  |  120|    490|    struct rtpp_pcnt_strm *: rtpp_pcnt_strm_smethods, \
  |  |  |  |  121|    490|    struct rtpp_ttl *: rtpp_ttl_smethods, \
  |  |  |  |  122|    490|    struct rtpp_pipe *: rtpp_pipe_smethods, \
  |  |  |  |  123|    490|    struct rtpp_ringbuf *: rtpp_ringbuf_smethods, \
  |  |  |  |  124|    490|    struct rtpp_sessinfo *: rtpp_sessinfo_smethods, \
  |  |  |  |  125|    490|    struct rtpp_rw_lock *: rtpp_rw_lock_smethods, \
  |  |  |  |  126|    490|    struct rtpp_proc_servers *: rtpp_proc_servers_smethods, \
  |  |  |  |  127|    490|    struct rtpp_proc_wakeup *: rtpp_proc_wakeup_smethods, \
  |  |  |  |  128|    490|    struct pproc_manager *: pproc_manager_smethods \
  |  |  |  |  129|    490|)
  |  |  ------------------
  ------------------
   95|    490|    pkt->pub.wi = &(pkt->pvt.wip.pub);
   96|       |
   97|    490|    return &(pkt->pub);
   98|    490|}
rtp_packet_parse:
  118|    490|{
  119|    490|    struct rtp_packet_full *pkt_full;
  120|    490|    struct rtp_info *rinfo;
  121|       |
  122|    490|    if (pkt->parse_result != RTP_PARSER_NOTPARSED) {
  ------------------
  |  Branch (122:9): [True: 0, False: 490]
  ------------------
  123|      0|        return (pkt->parse_result);
  124|      0|    }
  125|    490|    assert(pkt->parsed == NULL);
  126|    490|    pkt_full = (void *)pkt;
  127|    490|    rinfo = &(pkt_full->pvt.rinfo);
  128|    490|    pkt->parse_result = rtp_packet_parse_raw(pkt->data.buf, pkt->size, rinfo);
  129|    490|    if (pkt->parse_result == RTP_PARSER_OK) {
  ------------------
  |  Branch (129:9): [True: 405, False: 85]
  ------------------
  130|    405|        pkt->parsed = rinfo;
  131|    405|    }
  132|    490|    return (pkt->parse_result);
  133|    490|}

rtpp_analyzer_ctor:
   71|      1|{
   72|      1|    struct rtpp_analyzer_priv *pvt;
   73|      1|    struct rtpp_analyzer *rap;
   74|       |
   75|      1|    pvt = rtpp_rzmalloc(sizeof(struct rtpp_analyzer_priv), PVT_RCOFFS(pvt));
  ------------------
  |  |  144|      1|#define PVT_RCOFFS(pvtp) (offsetof(typeof(*(pvtp)), pub) + offsetof(typeof((pvtp)->pub), rcnt))
  ------------------
   76|      1|    if (pvt == NULL) {
  ------------------
  |  Branch (76:9): [True: 0, False: 1]
  ------------------
   77|      0|        return (NULL);
   78|      0|    }
   79|      1|    rap = &pvt->pub;
   80|      1|    if (rtpp_stats_init(&pvt->rstat) != 0) {
  ------------------
  |  Branch (80:9): [True: 0, False: 1]
  ------------------
   81|      0|        goto e0;
   82|      0|    }
   83|      1|    pvt->log = log;
   84|      1|    RTPP_OBJ_INCREF(log);
  ------------------
  |  |  151|      1|#define RTPP_OBJ_INCREF(obj) RC_INCREF((obj)->rcnt)
  |  |  ------------------
  |  |  |  |   66|      1|#define RC_INCREF(rp) CALL_SMETHOD(rp, incref);
  |  |  |  |  ------------------
  |  |  |  |  |  |  134|      1|#define CALL_SMETHOD(obj, method, args...) GET_SMETHODS(obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      1|#define GET_SMETHODS(obj) _Generic((obj), \
  |  |  |  |  |  |  |  |  108|      1|    struct rtpp_refcnt *: rtpp_refcnt_smethods, \
  |  |  |  |  |  |  |  |  109|      1|    struct rtpp_pearson_perfect *: rtpp_pearson_perfect_smethods, \
  |  |  |  |  |  |  |  |  110|      1|    struct rtpp_netaddr *: rtpp_netaddr_smethods, \
  |  |  |  |  |  |  |  |  111|      1|    struct rtpp_server *: rtpp_server_smethods, \
  |  |  |  |  |  |  |  |  112|      1|    struct rtpp_stats *: rtpp_stats_smethods, \
  |  |  |  |  |  |  |  |  113|      1|    struct rtpp_timed *: rtpp_timed_smethods, \
  |  |  |  |  |  |  |  |  114|      1|    struct rtpp_stream *: rtpp_stream_smethods, \
  |  |  |  |  |  |  |  |  115|      1|    struct rtpp_pcount *: rtpp_pcount_smethods, \
  |  |  |  |  |  |  |  |  116|      1|    struct rtpp_record *: rtpp_record_smethods, \
  |  |  |  |  |  |  |  |  117|      1|    struct rtpp_hash_table *: rtpp_hash_table_smethods, \
  |  |  |  |  |  |  |  |  118|      1|    struct rtpp_weakref *: rtpp_weakref_smethods, \
  |  |  |  |  |  |  |  |  119|      1|    struct rtpp_analyzer *: rtpp_analyzer_smethods, \
  |  |  |  |  |  |  |  |  120|      1|    struct rtpp_pcnt_strm *: rtpp_pcnt_strm_smethods, \
  |  |  |  |  |  |  |  |  121|      1|    struct rtpp_ttl *: rtpp_ttl_smethods, \
  |  |  |  |  |  |  |  |  122|      1|    struct rtpp_pipe *: rtpp_pipe_smethods, \
  |  |  |  |  |  |  |  |  123|      1|    struct rtpp_ringbuf *: rtpp_ringbuf_smethods, \
  |  |  |  |  |  |  |  |  124|      1|    struct rtpp_sessinfo *: rtpp_sessinfo_smethods, \
  |  |  |  |  |  |  |  |  125|      1|    struct rtpp_rw_lock *: rtpp_rw_lock_smethods, \
  |  |  |  |  |  |  |  |  126|      1|    struct rtpp_proc_servers *: rtpp_proc_servers_smethods, \
  |  |  |  |  |  |  |  |  127|      1|    struct rtpp_proc_wakeup *: rtpp_proc_wakeup_smethods, \
  |  |  |  |  |  |  |  |  128|      1|    struct pproc_manager *: pproc_manager_smethods \
  |  |  |  |  |  |  |  |  129|      1|)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   85|      1|    PUBINST_FININIT(&pvt->pub, pvt, rtpp_analyzer_dtor);
  ------------------
  |  |   76|      1|    CALL_SMETHOD((pub_inst)->rcnt, attach, (rtpp_refcnt_dtor_t)(dtor), \
  |  |  ------------------
  |  |  |  |  134|      1|#define CALL_SMETHOD(obj, method, args...) GET_SMETHODS(obj)->method(obj, ## args)
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|      1|#define GET_SMETHODS(obj) _Generic((obj), \
  |  |  |  |  |  |  108|      1|    struct rtpp_refcnt *: rtpp_refcnt_smethods, \
  |  |  |  |  |  |  109|      1|    struct rtpp_pearson_perfect *: rtpp_pearson_perfect_smethods, \
  |  |  |  |  |  |  110|      1|    struct rtpp_netaddr *: rtpp_netaddr_smethods, \
  |  |  |  |  |  |  111|      1|    struct rtpp_server *: rtpp_server_smethods, \
  |  |  |  |  |  |  112|      1|    struct rtpp_stats *: rtpp_stats_smethods, \
  |  |  |  |  |  |  113|      1|    struct rtpp_timed *: rtpp_timed_smethods, \
  |  |  |  |  |  |  114|      1|    struct rtpp_stream *: rtpp_stream_smethods, \
  |  |  |  |  |  |  115|      1|    struct rtpp_pcount *: rtpp_pcount_smethods, \
  |  |  |  |  |  |  116|      1|    struct rtpp_record *: rtpp_record_smethods, \
  |  |  |  |  |  |  117|      1|    struct rtpp_hash_table *: rtpp_hash_table_smethods, \
  |  |  |  |  |  |  118|      1|    struct rtpp_weakref *: rtpp_weakref_smethods, \
  |  |  |  |  |  |  119|      1|    struct rtpp_analyzer *: rtpp_analyzer_smethods, \
  |  |  |  |  |  |  120|      1|    struct rtpp_pcnt_strm *: rtpp_pcnt_strm_smethods, \
  |  |  |  |  |  |  121|      1|    struct rtpp_ttl *: rtpp_ttl_smethods, \
  |  |  |  |  |  |  122|      1|    struct rtpp_pipe *: rtpp_pipe_smethods, \
  |  |  |  |  |  |  123|      1|    struct rtpp_ringbuf *: rtpp_ringbuf_smethods, \
  |  |  |  |  |  |  124|      1|    struct rtpp_sessinfo *: rtpp_sessinfo_smethods, \
  |  |  |  |  |  |  125|      1|    struct rtpp_rw_lock *: rtpp_rw_lock_smethods, \
  |  |  |  |  |  |  126|      1|    struct rtpp_proc_servers *: rtpp_proc_servers_smethods, \
  |  |  |  |  |  |  127|      1|    struct rtpp_proc_wakeup *: rtpp_proc_wakeup_smethods, \
  |  |  |  |  |  |  128|      1|    struct pproc_manager *: pproc_manager_smethods \
  |  |  |  |  |  |  129|      1|)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   77|      1|      pvt_inst);
  ------------------
   86|      1|    return (rap);
   87|      0|e0:
   88|      0|    RTPP_OBJ_DECREF(&(pvt->pub));
  ------------------
  |  |  152|      0|#define RTPP_OBJ_DECREF(obj) RC_DECREF((obj)->rcnt)
  |  |  ------------------
  |  |  |  |   67|      0|#define RC_DECREF(rp) CALL_SMETHOD(rp, decref);
  |  |  |  |  ------------------
  |  |  |  |  |  |  134|      0|#define CALL_SMETHOD(obj, method, args...) GET_SMETHODS(obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define GET_SMETHODS(obj) _Generic((obj), \
  |  |  |  |  |  |  |  |  108|      0|    struct rtpp_refcnt *: rtpp_refcnt_smethods, \
  |  |  |  |  |  |  |  |  109|      0|    struct rtpp_pearson_perfect *: rtpp_pearson_perfect_smethods, \
  |  |  |  |  |  |  |  |  110|      0|    struct rtpp_netaddr *: rtpp_netaddr_smethods, \
  |  |  |  |  |  |  |  |  111|      0|    struct rtpp_server *: rtpp_server_smethods, \
  |  |  |  |  |  |  |  |  112|      0|    struct rtpp_stats *: rtpp_stats_smethods, \
  |  |  |  |  |  |  |  |  113|      0|    struct rtpp_timed *: rtpp_timed_smethods, \
  |  |  |  |  |  |  |  |  114|      0|    struct rtpp_stream *: rtpp_stream_smethods, \
  |  |  |  |  |  |  |  |  115|      0|    struct rtpp_pcount *: rtpp_pcount_smethods, \
  |  |  |  |  |  |  |  |  116|      0|    struct rtpp_record *: rtpp_record_smethods, \
  |  |  |  |  |  |  |  |  117|      0|    struct rtpp_hash_table *: rtpp_hash_table_smethods, \
  |  |  |  |  |  |  |  |  118|      0|    struct rtpp_weakref *: rtpp_weakref_smethods, \
  |  |  |  |  |  |  |  |  119|      0|    struct rtpp_analyzer *: rtpp_analyzer_smethods, \
  |  |  |  |  |  |  |  |  120|      0|    struct rtpp_pcnt_strm *: rtpp_pcnt_strm_smethods, \
  |  |  |  |  |  |  |  |  121|      0|    struct rtpp_ttl *: rtpp_ttl_smethods, \
  |  |  |  |  |  |  |  |  122|      0|    struct rtpp_pipe *: rtpp_pipe_smethods, \
  |  |  |  |  |  |  |  |  123|      0|    struct rtpp_ringbuf *: rtpp_ringbuf_smethods, \
  |  |  |  |  |  |  |  |  124|      0|    struct rtpp_sessinfo *: rtpp_sessinfo_smethods, \
  |  |  |  |  |  |  |  |  125|      0|    struct rtpp_rw_lock *: rtpp_rw_lock_smethods, \
  |  |  |  |  |  |  |  |  126|      0|    struct rtpp_proc_servers *: rtpp_proc_servers_smethods, \
  |  |  |  |  |  |  |  |  127|      0|    struct rtpp_proc_wakeup *: rtpp_proc_wakeup_smethods, \
  |  |  |  |  |  |  |  |  128|      0|    struct pproc_manager *: pproc_manager_smethods \
  |  |  |  |  |  |  |  |  129|      0|)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   89|      0|    free(pvt);
   90|      0|    return (NULL);
   91|      1|}
rtpp_analyzer.c:rtpp_analyzer_update:
   95|    490|{
   96|    490|    struct rtpp_analyzer_priv *pvt;
   97|    490|    enum update_rtpp_stats_rval rval;
   98|       |
   99|    490|    PUB2PVT(rap, pvt);
  ------------------
  |  |  147|    490|  (pvtp) = (typeof(pvtp))((char *)(pubp) - offsetof(typeof(*(pvtp)), pub))
  ------------------
  100|    490|    if (rtp_packet_parse(pkt) != RTP_PARSER_OK) {
  ------------------
  |  Branch (100:9): [True: 85, False: 405]
  ------------------
  101|     85|        pvt->pecount++;
  102|     85|        return (UPDATE_ERR);
  103|     85|    }
  104|    405|    rval = update_rtpp_stats(pvt->log, &(pvt->rstat), &(pkt->data.header),
  105|    405|      pkt->parsed, pkt->rtime.mono);
  106|    405|    if (rval == UPDATE_ERR) {
  ------------------
  |  Branch (106:9): [True: 19, False: 386]
  ------------------
  107|     19|        pvt->aecount++;
  108|     19|    }
  109|    405|    pvt->rstat.last.pt = pkt->data.header.pt;
  110|    405|    return (rval);
  111|    490|}

rtpp_genuid_ctor:
   48|      1|{
   49|      1|    struct rtpp_genuid_priv *pvt;
   50|       |
   51|      1|    pvt = rtpp_zmalloc(sizeof(struct rtpp_genuid_priv));
   52|      1|    if (pvt == NULL) {
  ------------------
  |  Branch (52:9): [True: 0, False: 1]
  ------------------
   53|      0|        goto e0;
   54|      0|    }
   55|      1|    atomic_init(&pvt->lastuid, 0);
   56|      1|    pvt->pub.dtor = &rtpp_genuid_dtor;
   57|      1|    pvt->pub.gen = &rtpp_genuid_gen;
   58|      1|    return (&pvt->pub);
   59|       |
   60|      0|e0:
   61|      0|    return (NULL);
   62|      1|}
rtpp_genuid.c:rtpp_genuid_gen:
   76|      1|{
   77|      1|    struct rtpp_genuid_priv *pvt;
   78|       |
   79|      1|    PUB2PVT(pub, pvt);
  ------------------
  |  |  147|      1|  (pvtp) = (typeof(pvtp))((char *)(pubp) - offsetof(typeof(*(pvtp)), pub))
  ------------------
   80|       |
   81|      1|    *vp = atomic_fetch_add_explicit(&(pvt->lastuid), 1,
   82|      1|      memory_order_relaxed);
   83|      1|}

rtpp_gen_uid_init:
   39|      1|{
   40|       |
   41|      1|    gup = rtpp_genuid_ctor();
   42|      1|    return (gup != NULL ? 0: -1);
  ------------------
  |  Branch (42:13): [True: 1, False: 0]
  ------------------
   43|      1|}
rtpp_gen_uid:
   56|      1|{
   57|       |
   58|      1|    CALL_METHOD(gup, gen, uip);
  ------------------
  |  |   83|      1|#define CALL_METHOD(obj, method, args...) (obj)->method(obj, ## args)
  ------------------
   59|      1|}

rtpp_log_ctor:
   74|      1|{
   75|      1|    struct rtpp_log_priv *pvt;
   76|       |
   77|      1|    pvt = rtpp_rzmalloc(sizeof(struct rtpp_log_priv), PVT_RCOFFS(pvt));
  ------------------
  |  |  144|      1|#define PVT_RCOFFS(pvtp) (offsetof(typeof(*(pvtp)), pub) + offsetof(typeof((pvtp)->pub), rcnt))
  ------------------
   78|      1|    if (pvt == NULL) {
  ------------------
  |  Branch (78:9): [True: 0, False: 1]
  ------------------
   79|      0|        return (NULL);
   80|      0|    }
   81|      1|    rtpp_gen_uid(&pvt->pub.lguid);
   82|      1|    pvt->pub.genwrite = rtpp_log_obj_write_early;
   83|      1|    pvt->pub.errwrite = rtpp_log_obj_ewrite_early;
   84|      1|    pvt->pub.setlevel = rtpp_log_obj_setlevel_early;
   85|      1|    pvt->pub.start = rtpp_log_obj_start;
   86|      1|    pvt->app = app;
   87|      1|    pvt->call_id = call_id;
   88|      1|    pvt->flags = flags;
   89|      1|    pvt->level = -1;
   90|      1|    CALL_SMETHOD(pvt->pub.rcnt, attach, (rtpp_refcnt_dtor_t)&rtpp_log_obj_dtor,
  ------------------
  |  |  134|      1|#define CALL_SMETHOD(obj, method, args...) GET_SMETHODS(obj)->method(obj, ## args)
  |  |  ------------------
  |  |  |  |  107|      1|#define GET_SMETHODS(obj) _Generic((obj), \
  |  |  |  |  108|      1|    struct rtpp_refcnt *: rtpp_refcnt_smethods, \
  |  |  |  |  109|      1|    struct rtpp_pearson_perfect *: rtpp_pearson_perfect_smethods, \
  |  |  |  |  110|      1|    struct rtpp_netaddr *: rtpp_netaddr_smethods, \
  |  |  |  |  111|      1|    struct rtpp_server *: rtpp_server_smethods, \
  |  |  |  |  112|      1|    struct rtpp_stats *: rtpp_stats_smethods, \
  |  |  |  |  113|      1|    struct rtpp_timed *: rtpp_timed_smethods, \
  |  |  |  |  114|      1|    struct rtpp_stream *: rtpp_stream_smethods, \
  |  |  |  |  115|      1|    struct rtpp_pcount *: rtpp_pcount_smethods, \
  |  |  |  |  116|      1|    struct rtpp_record *: rtpp_record_smethods, \
  |  |  |  |  117|      1|    struct rtpp_hash_table *: rtpp_hash_table_smethods, \
  |  |  |  |  118|      1|    struct rtpp_weakref *: rtpp_weakref_smethods, \
  |  |  |  |  119|      1|    struct rtpp_analyzer *: rtpp_analyzer_smethods, \
  |  |  |  |  120|      1|    struct rtpp_pcnt_strm *: rtpp_pcnt_strm_smethods, \
  |  |  |  |  121|      1|    struct rtpp_ttl *: rtpp_ttl_smethods, \
  |  |  |  |  122|      1|    struct rtpp_pipe *: rtpp_pipe_smethods, \
  |  |  |  |  123|      1|    struct rtpp_ringbuf *: rtpp_ringbuf_smethods, \
  |  |  |  |  124|      1|    struct rtpp_sessinfo *: rtpp_sessinfo_smethods, \
  |  |  |  |  125|      1|    struct rtpp_rw_lock *: rtpp_rw_lock_smethods, \
  |  |  |  |  126|      1|    struct rtpp_proc_servers *: rtpp_proc_servers_smethods, \
  |  |  |  |  127|      1|    struct rtpp_proc_wakeup *: rtpp_proc_wakeup_smethods, \
  |  |  |  |  128|      1|    struct pproc_manager *: pproc_manager_smethods \
  |  |  |  |  129|      1|)
  |  |  ------------------
  ------------------
   91|      1|      pvt);
   92|      1|    return (&pvt->pub);
   93|      1|}
rtpp_log_obj.c:rtpp_log_obj_write_early:
  158|    616|{
  159|    616|    va_list ap;
  160|    616|    struct rtpp_log_priv *pvt;
  161|       |
  162|    616|    PUB2PVT(self, pvt);
  ------------------
  |  |  147|    616|  (pvtp) = (typeof(pvtp))((char *)(pubp) - offsetof(typeof(*(pvtp)), pub))
  ------------------
  163|    616|    if (level > pvt->level)
  ------------------
  |  Branch (163:9): [True: 616, False: 0]
  ------------------
  164|    616|        return;
  165|      0|    fprintf(stderr, "%s: ", fname);
  166|      0|    va_start(ap, fmt);
  167|      0|    vfprintf(stderr, fmt, ap);
  168|      0|    va_end(ap);
  169|      0|    fprintf(stderr, "\n");
  170|      0|    fflush(stderr);
  171|      0|    return;
  172|    616|}

rtpp_zmalloc:
   46|     22|{
   47|     22|    void *rval;
   48|       |
   49|     22|#if !defined(RTPP_CHECK_LEAKS)
   50|     22|    rval = malloc(msize);
   51|       |#else
   52|       |    rval = rtpp_memdeb_malloc(msize, memdeb_p, mlp);
   53|       |#endif
   54|     22|    if (rval != NULL) {
  ------------------
  |  Branch (54:9): [True: 22, False: 0]
  ------------------
   55|     22|        memset(rval, '\0', msize);
   56|     22|    }
   57|     22|    return (rval);
   58|     22|}
rtpp_rzmalloc:
   74|    502|{
   75|    502|    void *rval;
   76|    502|    struct rtpp_refcnt *rcnt;
   77|    502|    size_t pad_size, asize;
   78|    502|    void *rco;
   79|       |
   80|    502|    RTPP_DBG_ASSERT(msize >= rcntp_offs + sizeof(struct rtpp_refcnt *));
   81|    502|    size_t norm_off = offsetof(struct alig_help, b);
   82|    502|    pad_size = (norm_off - msize) & (norm_off - 1);
   83|    502|    asize = msize + pad_size + rtpp_refcnt_osize;
   84|    502|#if !defined(RTPP_CHECK_LEAKS)
   85|    502|    rval = malloc(asize);
   86|       |#else
   87|       |    rval = rtpp_memdeb_malloc(asize, memdeb_p, mlp);
   88|       |#endif
   89|    502|    if (rval == NULL) {
  ------------------
  |  Branch (89:9): [True: 0, False: 502]
  ------------------
   90|      0|        return (NULL);
   91|      0|    }
   92|    502|    memset(rval, '\0', asize);
   93|    502|    rco = (char *)rval + msize + pad_size;
   94|    502|    rcnt = rtpp_refcnt_ctor_pa(rco);
   95|    502|    *PpP(rval, rcntp_offs, struct rtpp_refcnt **) = rcnt;
  ------------------
  |  |   65|    502|#define PpP(p1, p2, type) (type)(((char *)p1) + ((size_t)p2))
  ------------------
   96|       |
   97|    502|    return (rval);
   98|    502|}

rtpp_refcnt_ctor_pa:
  135|    502|{
  136|    502|    struct rtpp_refcnt_priv *pvt;
  137|       |
  138|    502|    pvt = (struct rtpp_refcnt_priv *)pap;
  139|       |#if defined(RTPP_DEBUG)
  140|       |    pvt->pub.smethods = rtpp_refcnt_smethods;
  141|       |#endif
  142|    502|    atomic_init(&pvt->cnt, 1);
  143|    502|    pvt->flags |= RC_FLAG_PA;
  ------------------
  |  |   62|    502|#define RC_FLAG_PA         (1 << 0)
  ------------------
  144|    502|    return (&pvt->pub);
  145|    502|}
rtpp_refcnt.c:rtpp_refcnt_incref:
  163|      1|{
  164|      1|    struct rtpp_refcnt_priv *pvt;
  165|       |
  166|      1|    PUB2PVT(pub, pvt);
  ------------------
  |  |  147|      1|  (pvtp) = (typeof(pvtp))((char *)(pubp) - offsetof(typeof(*(pvtp)), pub))
  ------------------
  167|       |#if RTPP_DEBUG_refcnt
  168|       |    if (pvt->flags & RC_FLAG_TRACE) {
  169|       |        char *dbuf;
  170|       |        asprintf(&dbuf, "rtpp_refcnt(%p, %u).incref()", pub,
  171|       |          atomic_load(&pvt->cnt));
  172|       |        if (dbuf != NULL) {
  173|       |#ifdef RTPP_DEBUG
  174|       |            rtpp_stacktrace_print(dbuf);
  175|       |#else
  176|       |            fprintf(stderr, "%s\n", dbuf);
  177|       |#endif
  178|       |            free(dbuf);
  179|       |        }
  180|       |    }
  181|       |#endif
  182|      1|    RTPP_DBG_ASSERT(atomic_load(&pvt->cnt) > 0 && atomic_load(&pvt->cnt) < RC_ABS_MAX);
  183|      1|    atomic_fetch_add_explicit(&pvt->cnt, 1, memory_order_relaxed);
  184|      1|}
rtpp_refcnt.c:rtpp_refcnt_decref:
  188|    490|{
  189|    490|    struct rtpp_refcnt_priv *pvt;
  190|    490|    int oldcnt;
  191|       |
  192|    490|    PUB2PVT(pub, pvt);
  ------------------
  |  |  147|    490|  (pvtp) = (typeof(pvtp))((char *)(pubp) - offsetof(typeof(*(pvtp)), pub))
  ------------------
  193|    490|    oldcnt = atomic_fetch_sub_explicit(&pvt->cnt, 1, memory_order_release);
  194|       |#if RTPP_DEBUG_refcnt
  195|       |    if (pvt->flags & RC_FLAG_TRACE) {
  196|       |        char *dbuf;
  197|       |        asprintf(&dbuf, "rtpp_refcnt(%p, %u).decref()", pub, oldcnt);
  198|       |        if (dbuf != NULL) {
  199|       |#ifdef RTPP_DEBUG
  200|       |            rtpp_stacktrace_print(dbuf);
  201|       |#else
  202|       |            fprintf(stderr, "%s\n", dbuf);
  203|       |#endif
  204|       |            free(dbuf);
  205|       |        }
  206|       |    }
  207|       |#endif
  208|    490|    if (oldcnt == 1) {
  ------------------
  |  Branch (208:9): [True: 490, False: 0]
  ------------------
  209|    490|        atomic_thread_fence(memory_order_acquire);
  210|    490|        int flags = pvt->flags;
  211|    490|        if ((flags & RC_FLAG_PA) == 0) {
  ------------------
  |  |   62|    490|#define RC_FLAG_PA         (1 << 0)
  ------------------
  |  Branch (211:13): [True: 0, False: 490]
  ------------------
  212|      0|            if (flags & RC_FLAG_HASPRDTOR) {
  ------------------
  |  |   65|      0|#define RC_FLAG_HASPRDTOR  (1 << 3)
  ------------------
  |  Branch (212:17): [True: 0, False: 0]
  ------------------
  213|      0|                pvt->pre_dtor_f(pvt->pd_data);
  214|      0|            }
  215|      0|            if (flags & RC_FLAG_HASDTOR) {
  ------------------
  |  |   64|      0|#define RC_FLAG_HASDTOR    (1 << 2)
  ------------------
  |  Branch (215:17): [True: 0, False: 0]
  ------------------
  216|      0|                pvt->dtor_f(pvt->data);
  217|      0|            } else {
  218|      0|#if !defined(RTPP_CHECK_LEAKS)
  219|      0|                free(pvt->data);
  220|       |#else
  221|       |                rtpp_refcnt_free(pvt->data);
  222|       |#endif
  223|      0|            }
  224|      0|            rtpp_refcnt_fin(pub);
  225|      0|            free(pvt);
  226|    490|        } else {
  227|    490|            rtpp_refcnt_fin(pub);
  228|    490|            if (flags & RC_FLAG_HASPRDTOR) {
  ------------------
  |  |   65|    490|#define RC_FLAG_HASPRDTOR  (1 << 3)
  ------------------
  |  Branch (228:17): [True: 0, False: 490]
  ------------------
  229|      0|                pvt->pre_dtor_f(pvt->pd_data);
  230|      0|            }
  231|    490|            if (flags & RC_FLAG_HASDTOR) {
  ------------------
  |  |   64|    490|#define RC_FLAG_HASDTOR    (1 << 2)
  ------------------
  |  Branch (231:17): [True: 0, False: 490]
  ------------------
  232|      0|                pvt->dtor_f(pvt->data);
  233|      0|            }
  234|    490|            if (flags & RC_FLAG_PA_STDFREE) {
  ------------------
  |  |   66|    490|#define RC_FLAG_PA_STDFREE (1 << 4)
  ------------------
  |  Branch (234:17): [True: 490, False: 0]
  ------------------
  235|    490|#if !defined(RTPP_CHECK_LEAKS)
  236|    490|                free(pvt->data);
  237|       |#else
  238|       |                rtpp_refcnt_free(pvt->data);
  239|       |#endif
  240|    490|            }
  241|    490|        }
  242|       |
  243|    490|        return;
  244|    490|    }
  245|    490|}
rtpp_refcnt.c:rtpp_refcnt_attach:
  150|     12|{
  151|     12|    struct rtpp_refcnt_priv *pvt;
  152|       |
  153|     12|    PUB2PVT(pub, pvt);
  ------------------
  |  |  147|     12|  (pvtp) = (typeof(pvtp))((char *)(pubp) - offsetof(typeof(*(pvtp)), pub))
  ------------------
  154|     12|    RTPP_DBG_ASSERT(pvt->data == NULL && pvt->dtor_f == NULL &&
  155|     12|      !(pvt->flags & RC_FLAG_HASDTOR));
  156|     12|    pvt->data = data;
  157|     12|    pvt->dtor_f = dtor_f;
  158|     12|    pvt->flags |= RC_FLAG_HASDTOR;
  ------------------
  |  |   64|     12|#define RC_FLAG_HASDTOR    (1 << 2)
  ------------------
  159|     12|}
rtpp_refcnt.c:rtpp_refcnt_use_stdfree:
  285|    490|{
  286|    490|    struct rtpp_refcnt_priv *pvt;
  287|       |
  288|    490|    PUB2PVT(pub, pvt);
  ------------------
  |  |  147|    490|  (pvtp) = (typeof(pvtp))((char *)(pubp) - offsetof(typeof(*(pvtp)), pub))
  ------------------
  289|    490|    RTPP_DBG_ASSERT(pvt->data == NULL && (pvt->flags & RC_FLAG_PA) &&
  290|    490|      !(pvt->flags & RC_FLAG_PA_STDFREE));
  291|    490|    pvt->flags |= RC_FLAG_PA_STDFREE;
  ------------------
  |  |   66|    490|#define RC_FLAG_PA_STDFREE (1 << 4)
  ------------------
  292|    490|    pvt->data = data;
  293|    490|}

rtpp_ringbuf_ctor:
   62|     10|{
   63|     10|    struct rtpp_ringbuf_priv *pvt;
   64|       |
   65|     10|    pvt = rtpp_rzmalloc(sizeof(struct rtpp_ringbuf_priv), PVT_RCOFFS(pvt));
  ------------------
  |  |  144|     10|#define PVT_RCOFFS(pvtp) (offsetof(typeof(*(pvtp)), pub) + offsetof(typeof((pvtp)->pub), rcnt))
  ------------------
   66|     10|    if (pvt == NULL) {
  ------------------
  |  Branch (66:9): [True: 0, False: 10]
  ------------------
   67|      0|        goto e0;
   68|      0|    }
   69|     10|    pvt->elements = rtpp_zmalloc(el_size * nelements);
   70|     10|    if (pvt->elements == NULL) {
  ------------------
  |  Branch (70:9): [True: 0, False: 10]
  ------------------
   71|      0|        goto e1;
   72|      0|    }
   73|     10|    pvt->el_size = el_size;
   74|     10|    pvt->nelements = nelements;
   75|     10|    PUBINST_FININIT(&pvt->pub, pvt, rtpp_ringbuf_dtor);
  ------------------
  |  |   76|     10|    CALL_SMETHOD((pub_inst)->rcnt, attach, (rtpp_refcnt_dtor_t)(dtor), \
  |  |  ------------------
  |  |  |  |  134|     10|#define CALL_SMETHOD(obj, method, args...) GET_SMETHODS(obj)->method(obj, ## args)
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|     10|#define GET_SMETHODS(obj) _Generic((obj), \
  |  |  |  |  |  |  108|     10|    struct rtpp_refcnt *: rtpp_refcnt_smethods, \
  |  |  |  |  |  |  109|     10|    struct rtpp_pearson_perfect *: rtpp_pearson_perfect_smethods, \
  |  |  |  |  |  |  110|     10|    struct rtpp_netaddr *: rtpp_netaddr_smethods, \
  |  |  |  |  |  |  111|     10|    struct rtpp_server *: rtpp_server_smethods, \
  |  |  |  |  |  |  112|     10|    struct rtpp_stats *: rtpp_stats_smethods, \
  |  |  |  |  |  |  113|     10|    struct rtpp_timed *: rtpp_timed_smethods, \
  |  |  |  |  |  |  114|     10|    struct rtpp_stream *: rtpp_stream_smethods, \
  |  |  |  |  |  |  115|     10|    struct rtpp_pcount *: rtpp_pcount_smethods, \
  |  |  |  |  |  |  116|     10|    struct rtpp_record *: rtpp_record_smethods, \
  |  |  |  |  |  |  117|     10|    struct rtpp_hash_table *: rtpp_hash_table_smethods, \
  |  |  |  |  |  |  118|     10|    struct rtpp_weakref *: rtpp_weakref_smethods, \
  |  |  |  |  |  |  119|     10|    struct rtpp_analyzer *: rtpp_analyzer_smethods, \
  |  |  |  |  |  |  120|     10|    struct rtpp_pcnt_strm *: rtpp_pcnt_strm_smethods, \
  |  |  |  |  |  |  121|     10|    struct rtpp_ttl *: rtpp_ttl_smethods, \
  |  |  |  |  |  |  122|     10|    struct rtpp_pipe *: rtpp_pipe_smethods, \
  |  |  |  |  |  |  123|     10|    struct rtpp_ringbuf *: rtpp_ringbuf_smethods, \
  |  |  |  |  |  |  124|     10|    struct rtpp_sessinfo *: rtpp_sessinfo_smethods, \
  |  |  |  |  |  |  125|     10|    struct rtpp_rw_lock *: rtpp_rw_lock_smethods, \
  |  |  |  |  |  |  126|     10|    struct rtpp_proc_servers *: rtpp_proc_servers_smethods, \
  |  |  |  |  |  |  127|     10|    struct rtpp_proc_wakeup *: rtpp_proc_wakeup_smethods, \
  |  |  |  |  |  |  128|     10|    struct pproc_manager *: pproc_manager_smethods \
  |  |  |  |  |  |  129|     10|)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   77|     10|      pvt_inst);
  ------------------
   76|     10|    return (&pvt->pub);
   77|      0|e1:
   78|      0|    RTPP_OBJ_DECREF(&(pvt->pub));
  ------------------
  |  |  152|      0|#define RTPP_OBJ_DECREF(obj) RC_DECREF((obj)->rcnt)
  |  |  ------------------
  |  |  |  |   67|      0|#define RC_DECREF(rp) CALL_SMETHOD(rp, decref);
  |  |  |  |  ------------------
  |  |  |  |  |  |  134|      0|#define CALL_SMETHOD(obj, method, args...) GET_SMETHODS(obj)->method(obj, ## args)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define GET_SMETHODS(obj) _Generic((obj), \
  |  |  |  |  |  |  |  |  108|      0|    struct rtpp_refcnt *: rtpp_refcnt_smethods, \
  |  |  |  |  |  |  |  |  109|      0|    struct rtpp_pearson_perfect *: rtpp_pearson_perfect_smethods, \
  |  |  |  |  |  |  |  |  110|      0|    struct rtpp_netaddr *: rtpp_netaddr_smethods, \
  |  |  |  |  |  |  |  |  111|      0|    struct rtpp_server *: rtpp_server_smethods, \
  |  |  |  |  |  |  |  |  112|      0|    struct rtpp_stats *: rtpp_stats_smethods, \
  |  |  |  |  |  |  |  |  113|      0|    struct rtpp_timed *: rtpp_timed_smethods, \
  |  |  |  |  |  |  |  |  114|      0|    struct rtpp_stream *: rtpp_stream_smethods, \
  |  |  |  |  |  |  |  |  115|      0|    struct rtpp_pcount *: rtpp_pcount_smethods, \
  |  |  |  |  |  |  |  |  116|      0|    struct rtpp_record *: rtpp_record_smethods, \
  |  |  |  |  |  |  |  |  117|      0|    struct rtpp_hash_table *: rtpp_hash_table_smethods, \
  |  |  |  |  |  |  |  |  118|      0|    struct rtpp_weakref *: rtpp_weakref_smethods, \
  |  |  |  |  |  |  |  |  119|      0|    struct rtpp_analyzer *: rtpp_analyzer_smethods, \
  |  |  |  |  |  |  |  |  120|      0|    struct rtpp_pcnt_strm *: rtpp_pcnt_strm_smethods, \
  |  |  |  |  |  |  |  |  121|      0|    struct rtpp_ttl *: rtpp_ttl_smethods, \
  |  |  |  |  |  |  |  |  122|      0|    struct rtpp_pipe *: rtpp_pipe_smethods, \
  |  |  |  |  |  |  |  |  123|      0|    struct rtpp_ringbuf *: rtpp_ringbuf_smethods, \
  |  |  |  |  |  |  |  |  124|      0|    struct rtpp_sessinfo *: rtpp_sessinfo_smethods, \
  |  |  |  |  |  |  |  |  125|      0|    struct rtpp_rw_lock *: rtpp_rw_lock_smethods, \
  |  |  |  |  |  |  |  |  126|      0|    struct rtpp_proc_servers *: rtpp_proc_servers_smethods, \
  |  |  |  |  |  |  |  |  127|      0|    struct rtpp_proc_wakeup *: rtpp_proc_wakeup_smethods, \
  |  |  |  |  |  |  |  |  128|      0|    struct pproc_manager *: pproc_manager_smethods \
  |  |  |  |  |  |  |  |  129|      0|)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   79|      0|    free(pvt);
   80|      0|e0:
   81|      0|    return (NULL);
   82|      0|}
rtpp_ringbuf.c:rtpp_ringbuf_push:
   95|    258|{
   96|    258|    struct rtpp_ringbuf_priv *pvt;
   97|    258|    void *dp;
   98|       |
   99|    258|    PUB2PVT(self, pvt);
  ------------------
  |  |  147|    258|  (pvtp) = (typeof(pvtp))((char *)(pubp) - offsetof(typeof(*(pvtp)), pub))
  ------------------
  100|    258|    dp = (char *)pvt->elements + (pvt->el_size * pvt->c_elem);
  101|    258|    memcpy(dp, data, pvt->el_size);
  102|    258|    pvt->c_elem++;
  103|    258|    if (pvt->c_elem == pvt->nelements) {
  ------------------
  |  Branch (103:9): [True: 13, False: 245]
  ------------------
  104|     13|        if (pvt->b_full == 0) {
  ------------------
  |  Branch (104:13): [True: 9, False: 4]
  ------------------
  105|      9|            pvt->b_full = 1;
  106|      9|        }
  107|     13|        pvt->c_elem = 0;
  108|     13|    }
  109|    258|}
rtpp_ringbuf.c:rtpp_ringbuf_flush:
  113|    115|{
  114|    115|    struct rtpp_ringbuf_priv *pvt;
  115|       |
  116|    115|    PUB2PVT(self, pvt);
  ------------------
  |  |  147|    115|  (pvtp) = (typeof(pvtp))((char *)(pubp) - offsetof(typeof(*(pvtp)), pub))
  ------------------
  117|    115|    pvt->b_full = 0;
  118|    115|    pvt->c_elem = 0;
  119|    115|}
rtpp_ringbuf.c:rtpp_ringbuf_locate:
  123|    289|{
  124|    289|    struct rtpp_ringbuf_priv *pvt;
  125|    289|    int i, last_el;
  126|    289|    void *dp;
  127|       |
  128|    289|    PUB2PVT(self, pvt);
  ------------------
  |  |  147|    289|  (pvtp) = (typeof(pvtp))((char *)(pubp) - offsetof(typeof(*(pvtp)), pub))
  ------------------
  129|    289|    last_el = (pvt->b_full != 0) ? pvt->nelements : pvt->c_elem;
  ------------------
  |  Branch (129:15): [True: 86, False: 203]
  ------------------
  130|  1.59k|    for (i = 0; i < last_el; i++) {
  ------------------
  |  Branch (130:17): [True: 1.33k, False: 258]
  ------------------
  131|  1.33k|        dp = (char *)pvt->elements + (pvt->el_size * i);
  132|  1.33k|        if (memcmp(dp, data, pvt->el_size) == 0) {
  ------------------
  |  Branch (132:13): [True: 31, False: 1.30k]
  ------------------
  133|     31|            return (i);
  134|     31|        }
  135|  1.33k|    }
  136|    258|    return (-1);
  137|    289|}

