Changeset 1761 for pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
- Timestamp:
- Jan 31, 2008 8:11:30 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
r1266 r1761 35 35 char *flist_buffer; 36 36 int *flist_frame_type; 37 pj_size_t *flist_content_len; 37 38 unsigned flist_frame_size; 38 39 unsigned flist_max_count; … … 110 111 framelist->flist_max_count); 111 112 113 framelist->flist_content_len = (pj_size_t*) 114 pj_pool_zalloc(pool, sizeof(framelist->flist_content_len[0]) * 115 framelist->flist_max_count); 116 112 117 framelist->flist_empty = 1; 113 118 … … 135 140 136 141 static pj_bool_t jb_framelist_get(jb_framelist_t *framelist, 137 void *frame, 142 void *frame, pj_size_t *size, 138 143 pjmedia_jb_frame_type *p_type) 139 144 { … … 145 150 *p_type = (pjmedia_jb_frame_type) 146 151 framelist->flist_frame_type[framelist->flist_head]; 152 *size = framelist->flist_content_len[framelist->flist_head]; 147 153 148 154 pj_bzero(framelist->flist_buffer + … … 151 157 framelist->flist_frame_type[framelist->flist_head] = 152 158 PJMEDIA_JB_MISSING_FRAME; 159 framelist->flist_content_len[framelist->flist_head] = 0; 153 160 154 161 framelist->flist_origin++; … … 195 202 PJMEDIA_JB_MISSING_FRAME, 196 203 step1*sizeof(framelist->flist_frame_type[0])); 204 pj_bzero(framelist->flist_content_len+framelist->flist_head, 205 step1*sizeof(framelist->flist_content_len[0])); 197 206 198 207 if (step2) { … … 202 211 PJMEDIA_JB_MISSING_FRAME, 203 212 step2*sizeof(framelist->flist_frame_type[0])); 213 pj_bzero (framelist->flist_content_len, 214 step2*sizeof(framelist->flist_content_len[0])); 204 215 } 205 216 … … 258 269 259 270 framelist->flist_frame_type[where] = PJMEDIA_JB_NORMAL_FRAME; 271 framelist->flist_content_len[where] = frame_size; 260 272 261 273 return PJ_TRUE; … … 511 523 char *p_frame_type) 512 524 { 525 pj_size_t size; 526 527 pjmedia_jbuf_get_frame2(jb, frame, &size, p_frame_type); 528 } 529 530 /* 531 * Get frame from jitter buffer. 532 */ 533 PJ_DEF(void) pjmedia_jbuf_get_frame2(pjmedia_jbuf *jb, 534 void *frame, 535 pj_size_t *size, 536 char *p_frame_type) 537 { 513 538 pjmedia_jb_frame_type ftype; 514 539 … … 531 556 *p_frame_type = PJMEDIA_JB_ZERO_PREFETCH_FRAME; 532 557 558 *size = 0; 559 533 560 return; 534 561 } 535 562 536 563 /* Retrieve a frame from frame list */ 537 if (jb_framelist_get(&jb->jb_framelist,frame, &ftype) == PJ_FALSE) {564 if (jb_framelist_get(&jb->jb_framelist,frame,size,&ftype) == PJ_FALSE) { 538 565 /* Can't return frame because jitter buffer is empty! */ 539 566 pj_bzero(frame, jb->jb_frame_size); 540 567 *p_frame_type = PJMEDIA_JB_ZERO_EMPTY_FRAME; 568 *size = 0; 541 569 542 570 return;
Note: See TracChangeset
for help on using the changeset viewer.