Changeset 2585


Ignore:
Timestamp:
Apr 8, 2009 6:22:31 PM (10 years ago)
Author:
nanang
Message:

Ticket #762: Updated delay calculation method & added statistic report in jbuf_destroy().

File:
1 edited

Legend:

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

    r2583 r2585  
    479479PJ_DEF(pj_status_t) pjmedia_jbuf_destroy(pjmedia_jbuf *jb) 
    480480{ 
     481    TRACE__((jb->jb_name.ptr, "\n" 
     482            "  JB summary:\n" 
     483            "    size=%d prefetch=%d\n" 
     484            "    delay (min/max/avg/dev)=%d/%d/%d/%d ms\n" 
     485            "    burst (min/max/avg/dev)=%d/%d/%d/%d frames\n" 
     486            "    lost=%d discard=%d empty=%d\n", 
     487            jb->jb_framelist.size, jb->jb_prefetch, 
     488            jb->jb_delay.min, jb->jb_delay.max, jb->jb_delay.mean,  
     489            pj_math_stat_get_stddev(&jb->jb_delay), 
     490            jb->jb_burst.min, jb->jb_burst.max, jb->jb_burst.mean,  
     491            pj_math_stat_get_stddev(&jb->jb_burst), 
     492            jb->jb_lost, jb->jb_discard, jb->jb_empty)); 
     493 
    481494    return jb_framelist_destroy(&jb->jb_framelist); 
    482495} 
     
    746759        if (ftype == PJMEDIA_JB_NORMAL_FRAME) { 
    747760            *p_frame_type = PJMEDIA_JB_NORMAL_FRAME; 
    748             pj_math_stat_update(&jb->jb_delay, cur_size * jb->jb_frame_ptime); 
    749761        } else { 
    750762            *p_frame_type = PJMEDIA_JB_MISSING_FRAME; 
    751763            jb->jb_lost++; 
    752764        } 
     765 
     766        /* Calculate delay on the first GET */ 
     767        if (jb->jb_last_op == JB_OP_PUT) 
     768            pj_math_stat_update(&jb->jb_delay, cur_size * jb->jb_frame_ptime); 
    753769    } 
    754770 
Note: See TracChangeset for help on using the changeset viewer.