Changeset 3568


Ignore:
Timestamp:
May 18, 2011 6:59:23 AM (9 years ago)
Author:
nanang
Message:

Fix #1258: Fixed bug in jitter buffer, i.e: unexpected state switches when prefetch mechanism is active, by separating prefetch mechanism from JB state.

Location:
pjproject/branches/1.x/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjmedia/build/Jbtest.dat

    r3396 r3568  
    317317%fixed 5 
    318318!burst      1 
    319 !discard    0 
    320 !lost       0 
     319!discard    4  <- the burst level is about 1, but prefetching will cause delay by 5 frames prefetching, delay adjustment may take place later on 
     320!lost       4  <- progressive discard drops frames as if they were lost 
    321321!empty      10 
    322322!delay      5 
  • pjproject/branches/1.x/pjmedia/src/pjmedia/jbuf.c

    r3561 r3568  
    120120                                             continuously updated based on 
    121121                                             current frame burst level.     */ 
     122    pj_bool_t       jb_prefetching;     /**< flag if jbuf is prefetching.   */ 
    122123    int             jb_status;          /**< status is 'init' until the first  
    123124                                             'put' operation                */ 
     
    141142#define JB_STATUS_INITIALIZING  0 
    142143#define JB_STATUS_PROCESSING    1 
    143 #define JB_STATUS_PREFETCHING   2 
    144144 
    145145 
     
    551551    jb->jb_init_cycle_cnt= 0; 
    552552    jb->jb_max_hist_level= 0; 
     553    jb->jb_prefetching   = (jb->jb_prefetch != 0); 
    553554 
    554555    jb_framelist_reset(&jb->jb_framelist); 
     
    861862 
    862863    if (status == PJ_SUCCESS) { 
    863         if (jb->jb_status == JB_STATUS_PREFETCHING) { 
     864        if (jb->jb_prefetching) { 
    864865            TRACE__((jb->jb_name.ptr, "PUT prefetch_cnt=%d/%d",  
    865866                     new_size, jb->jb_prefetch)); 
    866867            if (new_size >= jb->jb_prefetch) 
    867                 jb->jb_status = JB_STATUS_PROCESSING; 
     868                jb->jb_prefetching = PJ_FALSE; 
    868869        } 
    869870        jb->jb_level += (new_size > cur_size ? new_size-cur_size : 1); 
     
    892893                                     pj_uint32_t *bit_info) 
    893894{ 
    894     if (jb->jb_status == JB_STATUS_PREFETCHING) { 
     895    if (jb->jb_prefetching) { 
    895896 
    896897        /* Can't return frame because jitter buffer is filling up 
     
    939940            /* Jitter buffer is empty */ 
    940941            if (jb->jb_prefetch) 
    941                 jb->jb_status = JB_STATUS_PREFETCHING; 
     942                jb->jb_prefetching = PJ_TRUE; 
    942943 
    943944            //pj_bzero(frame, jb->jb_frame_size); 
Note: See TracChangeset for help on using the changeset viewer.