Changeset 3154 for pjproject/trunk


Ignore:
Timestamp:
Apr 30, 2010 10:22:05 AM (15 years ago)
Author:
nanang
Message:

Re #969: Fixed bug division by zero in JB progressive discard code, caused by possibility of uninitialized burst level after JB switches status INITIALIZING -> PROCESSING (thanks Janos Tolgyesi and Tamàs Solymosi for the report and investigation).

File:
1 edited

Legend:

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

    r3111 r3154  
    649649            if (++jb->jb_init_cycle_cnt >= INIT_CYCLE && oper == JB_OP_GET) { 
    650650                jb->jb_status = JB_STATUS_PROCESSING; 
     651                /* To make sure the burst calculation will be done right after 
     652                 * this, adjust burst level if it exceeds max burst level. 
     653                 */ 
     654                jb->jb_level = PJ_MIN(jb->jb_level, jb->jb_max_burst); 
    651655            } else { 
    652656                jb->jb_level = 0; 
     
    661665         * calculation. 
    662666         */ 
    663         if (oper == JB_OP_GET && jb->jb_level < jb->jb_max_burst) 
     667        if (oper == JB_OP_GET && jb->jb_level <= jb->jb_max_burst) 
    664668            jbuf_calculate_jitter(jb); 
    665669 
Note: See TracChangeset for help on using the changeset viewer.