Changeset 537


Ignore:
Timestamp:
Jun 22, 2006 6:44:11 PM (16 years ago)
Author:
bennylp
Message:

Fixed RTCP statistic returning fraction lost instead of total lost

Location:
pjproject/trunk/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/rtcp.h

    r518 r537  
    157157    pj_uint32_t     pkt;        /**< Total number of packets                */ 
    158158    pj_uint32_t     bytes;      /**< Total number of payload/bytes          */ 
    159     unsigned        discard;    /**< Number of discarded packets.           */ 
    160     unsigned        loss;       /**< Number of packets lost                 */ 
    161     unsigned        reorder;    /**< Number of out of order packets         */ 
    162     unsigned        dup;        /**< Number of duplicates packets           */ 
     159    unsigned        discard;    /**< Total number of discarded packets.     */ 
     160    unsigned        loss;       /**< Total number of packets lost           */ 
     161    unsigned        reorder;    /**< Total number of out of order packets   */ 
     162    unsigned        dup;        /**< Total number of duplicates packets     */ 
    163163 
    164164    struct { 
  • pjproject/trunk/pjmedia/src/pjmedia/rtcp.c

    r455 r537  
    208208    } 
    209209     
    210     if (seq_st.status.flag.dup) 
     210    if (seq_st.status.flag.dup) { 
    211211        sess->stat.rx.dup++; 
    212     if (seq_st.status.flag.outorder) 
     212        TRACE_((sess->name, "Duplicate packet detected")); 
     213    } 
     214 
     215    if (seq_st.status.flag.outorder) { 
    213216        sess->stat.rx.reorder++; 
     217        TRACE_((sess->name, "Out-of-order packet detected")); 
     218    } 
    214219 
    215220    if (seq_st.status.flag.bad) { 
    216221        sess->stat.rx.discard++; 
     222        TRACE_((sess->name, "Bad packet discarded")); 
    217223        return; 
    218224    } 
     
    234240         */ 
    235241        sess->stat.rx.loss += (seq_st.diff - 1); 
     242        TRACE_((sess->name, "%d packet(s) lost", seq_st.diff - 1)); 
    236243 
    237244        /* Update loss period stat */ 
     
    542549    /* Total lost. */ 
    543550    expected = pj_ntohl(rtcp_pkt->rr.last_seq) - sess->seq_ctrl.base_seq; 
     551 
     552    /* This is bug: total lost already calculated on each incoming RTP! 
    544553    if (expected >= sess->received) 
    545554        sess->stat.rx.loss = expected - sess->received; 
    546555    else 
    547556        sess->stat.rx.loss = 0; 
     557    */ 
    548558 
    549559    rtcp_pkt->rr.total_lost_2 = (sess->stat.rx.loss >> 16) & 0xFF; 
Note: See TracChangeset for help on using the changeset viewer.