Changeset 2224
- Timestamp:
- Aug 19, 2008 12:11:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r2100 r2224 144 144 normalization process 145 145 is needed */ 146 unsigned rtp_tx_ samples_per_pkt;147 /**< Normalized samples per packet146 unsigned rtp_tx_ts_len_per_pkt; 147 /**< Normalized ts length per packet 148 148 transmitted according to 149 149 'erroneous' definition */ 150 unsigned rtp_rx_ samples_per_frame;151 /**< Normalized samples per frame150 unsigned rtp_rx_ts_len_per_frame; 151 /**< Normalized ts length per frame 152 152 received according to 153 153 'erroneous' definition */ … … 687 687 /* Number of samples in the frame */ 688 688 if (frame->type == PJMEDIA_FRAME_TYPE_AUDIO) 689 ts_len = (frame->size >> 1) ;689 ts_len = (frame->size >> 1) / stream->codec_param.info.channel_cnt; 690 690 else 691 691 ts_len = 0; … … 699 699 */ 700 700 if (stream->has_g722_mpeg_bug) 701 rtp_ts_len = stream->rtp_tx_ samples_per_pkt;701 rtp_ts_len = stream->rtp_tx_ts_len_per_pkt; 702 702 else 703 703 rtp_ts_len = ts_len; … … 1247 1247 stream->port.info.samples_per_frame >> 1)) 1248 1248 { 1249 if (peer_frm_ts_diff < stream->rtp_rx_ samples_per_frame)1250 stream->rtp_rx_ samples_per_frame = peer_frm_ts_diff;1249 if (peer_frm_ts_diff < stream->rtp_rx_ts_len_per_frame) 1250 stream->rtp_rx_ts_len_per_frame = peer_frm_ts_diff; 1251 1251 1252 1252 if (--stream->rtp_rx_check_cnt == 0) { 1253 1253 PJ_LOG(4, (THIS_FILE, "G722 codec used, remote" 1254 1254 " samples per frame detected = %d", 1255 stream->rtp_rx_ samples_per_frame));1255 stream->rtp_rx_ts_len_per_frame)); 1256 1256 1257 1257 /* Reset jitter buffer once detection done */ … … 1265 1265 } 1266 1266 1267 ts_span = stream->rtp_rx_ samples_per_frame;1267 ts_span = stream->rtp_rx_ts_len_per_frame; 1268 1268 1269 1269 } else { 1270 1270 ts_span = stream->codec_param.info.frm_ptime * 1271 stream->codec_param.info.clock_rate * 1272 stream->codec_param.info.channel_cnt / 1271 stream->codec_param.info.clock_rate / 1273 1272 1000; 1274 1273 } 1275 1274 #else 1276 1275 ts_span = stream->codec_param.info.frm_ptime * 1277 stream->codec_param.info.clock_rate * 1278 stream->codec_param.info.channel_cnt / 1276 stream->codec_param.info.clock_rate / 1279 1277 1000; 1280 1278 #endif … … 1563 1561 1564 1562 stream->enc_samples_per_pkt = stream->codec_param.info.enc_ptime * 1563 stream->codec_param.info.channel_cnt * 1565 1564 stream->port.info.clock_rate / 1000; 1566 1565 … … 1613 1612 stream->rtp_rx_last_ts = 0; 1614 1613 stream->rtp_rx_last_cnt = 0; 1615 stream->rtp_tx_samples_per_pkt = stream->enc_samples_per_pkt; 1616 stream->rtp_rx_samples_per_frame = stream->port.info.samples_per_frame; 1614 stream->rtp_tx_ts_len_per_pkt = stream->enc_samples_per_pkt / 1615 stream->codec_param.info.channel_cnt; 1616 stream->rtp_rx_ts_len_per_frame = stream->port.info.samples_per_frame / 1617 stream->codec_param.info.channel_cnt; 1617 1618 1618 1619 /* Init RTCP session: */ … … 1626 1627 stream->has_g722_mpeg_bug = PJ_TRUE; 1627 1628 /* RTP clock rate = 1/2 real clock rate */ 1628 stream->rtp_tx_ samples_per_pkt >>= 1;1629 stream->rtp_tx_ts_len_per_pkt >>= 1; 1629 1630 } else { 1630 1631 pjmedia_rtcp_init(&stream->rtcp, stream->port.info.name.ptr,
Note: See TracChangeset
for help on using the changeset viewer.