Changeset 1922 for pjproject/trunk


Ignore:
Timestamp:
Apr 10, 2008 11:51:04 AM (17 years ago)
Author:
bennylp
Message:

More ticket #505: the jitter buffer only discard one packet at a time when optimizing the delay

File:
1 edited

Legend:

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

    r1887 r1922  
    8484 */ 
    8585#if 1 
    86 #  define TRACE__(args)     PJ_LOG(4,args) 
     86#  define TRACE__(args)     PJ_LOG(5,args) 
    8787#else 
    8888#  define TRACE__(args) 
     
    396396        if (jb->jb_level < jb->jb_prefetch) { 
    397397 
    398             static const int stable_history_limit = 100; 
     398            enum { STABLE_HISTORY_LIMIT = 100 }; 
    399399             
    400400            jb->jb_stable_hist++; 
     
    403403             * (not just short time impulse) 
    404404             */ 
    405             if (jb->jb_stable_hist > (int)stable_history_limit) { 
     405            if (jb->jb_stable_hist > STABLE_HISTORY_LIMIT) { 
    406406                diff = (jb->jb_prefetch - jb->jb_max_hist_level) / 3; 
    407407 
     
    445445    diff = jb_framelist_size(&jb->jb_framelist) - jb->jb_prefetch; 
    446446    if (diff > SAFE_SHRINKING_DIFF) { 
    447          
    448         /* Drop some frames so jitter buffer size should be == jb_prefetch */ 
     447        /* Shrink slowly */ 
     448        diff = 1; 
     449 
     450        /* Drop frame(s)! */ 
    449451        jb_framelist_remove_head(&jb->jb_framelist, diff); 
    450452 
    451453        TRACE__((jb->name.ptr,  
    452                  "JB shrinking %d frames, size=%d", diff, 
     454                 "JB shrinking %d frame(s), size=%d", diff, 
    453455                 jb_framelist_size(&jb->jb_framelist))); 
    454456    } 
Note: See TracChangeset for help on using the changeset viewer.