- Timestamp:
- Feb 1, 2010 11:23:54 AM (15 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r2755 r3085 373 373 // conf->samples_per_frame * 374 374 // conf_port->clock_rate * 1.0 / 375 // conf->clock_rate );375 // conf->clock_rate + 0.5); 376 376 conf_port->rx_buf_cap = conf_port->clock_rate * buff_ptime / 1000; 377 377 if (conf_port->channel_count > conf->channel_count) … … 1438 1438 1439 1439 samples_req = (unsigned) (count * 1.0 * 1440 cport->clock_rate / conf->clock_rate );1440 cport->clock_rate / conf->clock_rate + 0.5); 1441 1441 1442 1442 while (cport->rx_buf_count < samples_req) { … … 1510 1510 1511 1511 src_count = (unsigned)(count * 1.0 * cport->clock_rate / 1512 conf->clock_rate );1512 conf->clock_rate + 0.5); 1513 1513 cport->rx_buf_count -= src_count; 1514 1514 if (cport->rx_buf_count) { … … 1694 1694 cport->tx_buf + cport->tx_buf_count ); 1695 1695 dst_count = (unsigned)(conf->samples_per_frame * 1.0 * 1696 cport->clock_rate / conf->clock_rate );1696 cport->clock_rate / conf->clock_rate + 0.5); 1697 1697 } else { 1698 1698 /* Same clock rate. -
pjproject/trunk/pjmedia/src/pjmedia/resample_resample.c
r2394 r3085 124 124 /* Allocate temporary output buffer */ 125 125 size = (unsigned) (resample->frame_size * sizeof(pj_int16_t) * 126 resample->factor / channel_count );126 resample->factor / channel_count + 0.5); 127 127 resample->tmp_buffer = (pj_int16_t*) pj_pool_alloc(pool, size); 128 128 PJ_ASSERT_RETURN(resample->tmp_buffer, PJ_ENOMEM); … … 246 246 247 247 mono_frm_sz_in = resample->frame_size / resample->channel_cnt; 248 mono_frm_sz_out = (unsigned)(mono_frm_sz_in * resample->factor );248 mono_frm_sz_out = (unsigned)(mono_frm_sz_in * resample->factor + 0.5); 249 249 250 250 /* Deinterleave input */ -
pjproject/trunk/third_party/resample/src/resamplesubs.c
r1969 r3085 119 119 120 120 Ystart = Y; 121 Yend = Ystart + (unsigned)(nx * pFactor );121 Yend = Ystart + (unsigned)(nx * pFactor + 0.5); 122 122 endTime = time + (1<<Np)*(RES_WORD)nx; 123 while (time < endTime) 123 124 // Integer round down in dtb calculation may cause (endTime % dtb > 0), 125 // so it may cause resample write pass the output buffer (Y >= Yend). 126 // while (time < endTime) 127 while (Y < Yend) 124 128 { 125 129 iconst = (time) & Pmask; … … 258 262 259 263 Ystart = Y; 260 Yend = Ystart + (unsigned)(nx * pFactor );264 Yend = Ystart + (unsigned)(nx * pFactor + 0.5); 261 265 endTime = time + (1<<Np)*(RES_WORD)nx; 262 266 … … 306 310 307 311 Ystart = Y; 308 Yend = Ystart + (unsigned)(nx * pFactor );312 Yend = Ystart + (unsigned)(nx * pFactor + 0.5); 309 313 endTime = time + (1<<Np)*(RES_WORD)nx; 310 314
Note: See TracChangeset
for help on using the changeset viewer.