Changeset 887 for pjproject/trunk/pjmedia/src/pjmedia/conference.c
- Timestamp:
- Jan 20, 2007 5:14:24 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r864 r887 1312 1312 */ 1313 1313 static pj_status_t write_port(pjmedia_conf *conf, struct conf_port *cport, 1314 pj_uint32_ttimestamp,1314 const pj_timestamp *timestamp, 1315 1315 pjmedia_frame_type *frm_type) 1316 1316 { 1317 1317 pj_int16_t *buf; 1318 unsigned j ;1318 unsigned j, ts; 1319 1319 pj_status_t status; 1320 1320 … … 1332 1332 pjmedia_frame frame; 1333 1333 1334 /* Adjust the timestamp */ 1335 frame.timestamp.u64 = timestamp->u64 * cport->clock_rate / 1336 conf->clock_rate; 1334 1337 frame.type = PJMEDIA_FRAME_TYPE_NONE; 1335 1338 frame.buf = NULL; … … 1458 1461 frame.buf = (pj_int16_t*)cport->mix_buf; 1459 1462 frame.size = conf->samples_per_frame * BYTES_PER_SAMPLE; 1460 frame.timestamp.u64 = timestamp; 1463 /* No need to adjust timestamp, port has the same 1464 * clock rate as conference bridge 1465 */ 1466 frame.timestamp = *timestamp; 1461 1467 1462 1468 TRACE_((THIS_FILE, "put_frame %.*s, count=%d", … … 1492 1498 /* Transmit while we have enough frame in the tx_buf. */ 1493 1499 status = PJ_SUCCESS; 1500 ts = 0; 1494 1501 while (cport->tx_buf_count >= cport->samples_per_frame && 1495 1502 status == PJ_SUCCESS) … … 1506 1513 frame.buf = cport->tx_buf; 1507 1514 frame.size = cport->samples_per_frame * BYTES_PER_SAMPLE; 1508 frame.timestamp.u64 = timestamp; 1515 /* Adjust timestamp as port may have different clock rate 1516 * than the bridge. 1517 */ 1518 frame.timestamp.u64 = timestamp->u64 * cport->clock_rate / 1519 conf->clock_rate; 1520 1521 /* Add timestamp for individual frame */ 1522 frame.timestamp.u64 += ts; 1523 ts += cport->samples_per_frame; 1509 1524 1510 1525 TRACE_((THIS_FILE, "put_frame %.*s, count=%d", … … 1747 1762 ++ci; 1748 1763 1749 status = write_port( conf, conf_port, frame->timestamp.u32.lo,1764 status = write_port( conf, conf_port, &frame->timestamp, 1750 1765 &frm_type); 1751 1766 if (status != PJ_SUCCESS) {
Note: See TracChangeset
for help on using the changeset viewer.