Changeset 229 for pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
- Timestamp:
- Feb 25, 2006 9:15:49 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
r228 r229 24 24 #include <pj/pool.h> 25 25 #include <pj/assert.h> 26 #include <pj/log.h> 26 27 #include <pj/string.h> 27 28 29 30 #define THIS_FILE "jbuf.c" 28 31 29 32 … … 55 58 int jb_max_hist_jitter; // max jitter during the last jitter calculations 56 59 int jb_stable_hist; // num of times the delay has been lower then the prefetch num 60 unsigned jb_op_count; // of of operations. 57 61 int jb_last_op; // last operation executed on the framelist->flist_buffer (put/get) 58 62 int jb_last_seq_no; // seq no. of the last frame inserted to the framelist->flist_buffer … … 293 297 jb->jb_last_level = jb->jb_level; 294 298 jb->jb_max_hist_jitter = PJ_MAX(jb->jb_max_hist_jitter,jb->jb_last_jitter); 295 296 if (jb->jb_last_jitter< jb->jb_prefetch) { 299 jb->jb_op_count++; 300 301 if (jb->jb_last_jitter < jb->jb_prefetch) { 297 302 jb->jb_stable_hist += jb->jb_last_jitter; 298 303 if (jb->jb_stable_hist > STABLE_HISTORY_LIMIT) { … … 305 310 jb->jb_stable_hist = 0; 306 311 jb->jb_max_hist_jitter = 0; 312 313 if (jb->jb_op_count >= 100 && 314 (int)jb_framelist_size(&jb->jb_framelist) > jb->jb_prefetch+2) 315 { 316 jb_framelist_remove_head(&jb->jb_framelist,1); 317 318 PJ_LOG(5,(THIS_FILE, "jbuf prefetch: %d, size=%d", 319 jb->jb_prefetch, 320 jb_framelist_size(&jb->jb_framelist))); 321 jb->jb_op_count = 0; 322 } 323 307 324 } 308 325 } else { … … 310 327 jb->jb_stable_hist = 0; 311 328 jb->jb_max_hist_jitter = 0; 329 330 if (jb->jb_op_count >= 100) { 331 if ((int)jb_framelist_size(&jb->jb_framelist) > jb->jb_prefetch+2) { 332 jb_framelist_remove_head(&jb->jb_framelist,1); 333 334 PJ_LOG(5,(THIS_FILE, "jbuf prefetch: %d, size=%d", 335 jb->jb_prefetch, 336 jb_framelist_size(&jb->jb_framelist))); 337 } 338 339 jb->jb_op_count = 0; 340 } 312 341 } 313 342 }
Note: See TracChangeset
for help on using the changeset viewer.