Ticket #505: ticket505.3.patch
File ticket505.3.patch, 1.5 KB (added by nanang, 16 years ago) |
---|
-
pjmedia/src/pjmedia/jbuf.c
82 82 /* Enabling this would log the jitter buffer state about once per 83 83 * second. 84 84 */ 85 #if 186 # define TRACE__(args) PJ_LOG( 4,args)85 #if 0 86 # define TRACE__(args) PJ_LOG(5,args) 87 87 #else 88 88 # define TRACE__(args) 89 89 #endif … … 395 395 /* Level is decreasing */ 396 396 if (jb->jb_level < jb->jb_prefetch) { 397 397 398 static const int stable_history_limit = 100;398 enum { STABLE_HISTORY_LIMIT = 100 }; 399 399 400 400 jb->jb_stable_hist++; 401 401 402 402 /* Only update the prefetch if 'stable' condition is reached 403 403 * (not just short time impulse) 404 404 */ 405 if (jb->jb_stable_hist > (int)stable_history_limit) {405 if (jb->jb_stable_hist > STABLE_HISTORY_LIMIT) { 406 406 diff = (jb->jb_prefetch - jb->jb_max_hist_level) / 3; 407 407 408 408 if (diff < 1) … … 444 444 /* These code is used for shortening the delay in the jitter buffer. */ 445 445 diff = jb_framelist_size(&jb->jb_framelist) - jb->jb_prefetch; 446 446 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)! */ 449 451 jb_framelist_remove_head(&jb->jb_framelist, diff); 450 452 451 453 TRACE__((jb->name.ptr, 452 "JB shrinking %d frame s, size=%d", diff,454 "JB shrinking %d frame(s), size=%d", diff, 453 455 jb_framelist_size(&jb->jb_framelist))); 454 456 } 455 457