Changeset 389


Ignore:
Timestamp:
Apr 5, 2006 10:05:04 PM (18 years ago)
Author:
bennylp
Message:

Protect RTCP packet lost calculation against incorrect packet expectations

Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/rtcp.c

    r388 r389  
    262262    /* Total lost. */ 
    263263    expected = pj_ntohl(rtcp_pkt->rr.last_seq) - s->seq_ctrl.base_seq; 
    264     u32 = expected - s->received; 
     264    if (expected >= s->received) 
     265        u32 = expected - s->received; 
     266    else 
     267        u32 = 0; 
    265268    rtcp_pkt->rr.total_lost_2 = (u32 >> 16) & 0x00FF; 
    266269    rtcp_pkt->rr.total_lost_1 = (u32 >> 8) & 0x00FF; 
  • pjproject/trunk/pjsip-apps/src/samples/siprtp.c

    r388 r389  
    14171417 
    14181418    /* Print duration */ 
    1419     if (inv->state == PJSIP_INV_STATE_CONFIRMED) { 
     1419    if (inv->state >= PJSIP_INV_STATE_CONFIRMED) { 
    14201420        pj_time_val now; 
    14211421 
Note: See TracChangeset for help on using the changeset viewer.