Changeset 3396


Ignore:
Timestamp:
Dec 14, 2010 8:39:47 PM (10 years ago)
Author:
nanang
Message:

Fix #1188:

  • Fixed jitter buffer progressive discard by returning 'missing' frame after discarded frame(s) so the PLC will be invoked to align the audio signal.
  • Modified conditions in jitter buffer test data for this fix.
Location:
pjproject/trunk/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/build/Jbtest.dat

    r3065 r3396  
    144144!burst      4 
    145145!discard    68 <- number of PUT - GET, JB does shrinking by discarding frames 
    146 !lost       0 
     146!lost       68 <- ticket #1188, normal frame after discarded frame is flagged 'lost' to align signal 
    147147!empty      4 
    148148!delay      8  <- should be less than or equal to twice of burst 
     
    294294!burst      1 
    295295!discard    50 <- frames discarded for delay adaptation 
    296 !lost       0 
     296!lost       50 <- ticket #1188, normal frame after discarded frame is flagged 'lost' to align signal 
    297297!empty      0 
    298298!delay      25 <- average delay, JB is able to adapt the delay 
     
    348348!burst      1 
    349349!discard    50 <- frames discarded for delay adaptation 
    350 !lost       0 
     350!lost       50 <- ticket #1188, normal frame after discarded frame is flagged 'lost' to align signal 
    351351!empty      0 
    352352!delay      20 <- average delay, twice of minimal prefetch 
     
    372372!burst      10 
    373373!discard    300 <- not so relevant for long period session with many delay adjustments needed (i.e: for first burst and periodic spikes) 
    374 !lost       0 
     374!lost       300 <- ticket #1188, normal frame after discarded frame is flagged 'lost' to align signal 
    375375!empty      60 <- delay adjustment effect, as there is actually no drift 
    376376!delay      20 <- twice of burst level average 
  • pjproject/trunk/pjmedia/src/pjmedia/jbuf.c

    r3359 r3396  
    262262{ 
    263263    if (framelist->size) { 
     264        pj_bool_t prev_discarded = PJ_FALSE; 
    264265 
    265266        /* Skip discarded frames */ 
     
    268269        { 
    269270            jb_framelist_remove_head(framelist, 1); 
     271            prev_discarded = PJ_TRUE; 
    270272        } 
    271273 
    272274        /* Return the head frame if any */ 
    273275        if (framelist->size) { 
    274             pj_memcpy(frame,  
    275                       framelist->content +  
    276                       framelist->head * framelist->frame_size, 
    277                       framelist->frame_size); 
    278             *p_type = (pjmedia_jb_frame_type)  
    279                       framelist->frame_type[framelist->head]; 
    280             if (size) 
    281                 *size   = framelist->content_len[framelist->head]; 
    282             if (bit_info) 
    283                 *bit_info = framelist->bit_info[framelist->head]; 
     276            if (prev_discarded) { 
     277                /* Ticket #1188: when previous frame(s) was discarded, return 
     278                 * 'missing' frame to trigger PLC to get smoother signal. 
     279                 */ 
     280                *p_type = PJMEDIA_JB_MISSING_FRAME; 
     281                if (size) 
     282                    *size = 0; 
     283                if (bit_info) 
     284                    *bit_info = 0; 
     285            } else { 
     286                pj_memcpy(frame,  
     287                          framelist->content +  
     288                          framelist->head * framelist->frame_size, 
     289                          framelist->frame_size); 
     290                *p_type = (pjmedia_jb_frame_type)  
     291                          framelist->frame_type[framelist->head]; 
     292                if (size) 
     293                    *size   = framelist->content_len[framelist->head]; 
     294                if (bit_info) 
     295                    *bit_info = framelist->bit_info[framelist->head]; 
     296            } 
    284297 
    285298            //pj_bzero(framelist->content +  
Note: See TracChangeset for help on using the changeset viewer.