Changeset 2019 for pjproject/trunk
- Timestamp:
- Jun 14, 2008 4:44:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
r1983 r2019 31 31 #define THIS_FILE "jbuf.c" 32 32 33 #define SAFE_SHRINKING_DIFF 2 33 #define SAFE_SHRINKING_DIFF 1 34 #define MIN_SHRINK_GAP_MSEC 200 34 35 #define USE_PREFETCH_BUFFERING 0 35 36 … … 70 71 int jb_status; // status is 'init' until the first 'put' operation 71 72 pj_math_stat jb_delay; // Delay statistics of jitter buffer (in frame unit) 73 74 unsigned jb_last_del_seq; // Seq # of last frame deleted 75 unsigned jb_min_shrink_gap; // How often can we shrink 72 76 }; 73 77 … … 319 323 jb->jb_max_hist_level = 0; 320 324 jb->jb_max_count = max_count; 325 jb->jb_min_shrink_gap= MIN_SHRINK_GAP_MSEC / ptime; 321 326 322 327 pj_math_stat_init(&jb->jb_delay); … … 458 463 /* These code is used for shortening the delay in the jitter buffer. */ 459 464 diff = cur_size - jb->jb_prefetch; 460 if (diff > SAFE_SHRINKING_DIFF) { 465 if (diff > SAFE_SHRINKING_DIFF && 466 jb->jb_framelist.flist_origin-jb->jb_last_del_seq > jb->jb_min_shrink_gap) 467 { 461 468 /* Shrink slowly */ 462 469 diff = 1; … … 464 471 /* Drop frame(s)! */ 465 472 jb_framelist_remove_head(&jb->jb_framelist, diff); 473 jb->jb_last_del_seq = jb->jb_framelist.flist_origin; 466 474 467 475 pj_math_stat_update(&jb->jb_delay, cur_size - diff);
Note: See TracChangeset
for help on using the changeset viewer.