Changeset 311 for pjproject/trunk
- Timestamp:
- Mar 8, 2006 10:05:19 AM (19 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 2 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/build/pjmedia.dsp
r278 r311 146 146 # Begin Source File 147 147 148 SOURCE=..\src\pjmedia\rtp_port.c149 # End Source File150 # Begin Source File151 152 148 SOURCE=..\src\pjmedia\sdp.c 153 149 # End Source File … … 231 227 232 228 SOURCE=..\include\pjmedia\rtp.h 233 # End Source File234 # Begin Source File235 236 SOURCE=..\include\pjmedia\rtp_port.h237 229 # End Source File 238 230 # Begin Source File -
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r290 r311 42 42 #define PJMEDIA_MAX_MTU 1500 43 43 #define PJMEDIA_DTMF_DURATION 1600 /* in timestamp */ 44 #define PJMEDIA_RTP_NAT_PROBATION_CNT 10 44 45 45 46 … … 98 99 pj_sockaddr_in rem_rtcp_addr; /**< Remote RTCP address. */ 99 100 101 pj_sockaddr_in rem_src_rtp; /**< addr of src pkt from remote*/ 102 unsigned rem_src_cnt; /**< if different, # of pkt rcv */ 103 100 104 pj_rtcp_session rtcp; /**< RTCP for incoming RTP. */ 101 105 … … 451 455 const void *payload; 452 456 unsigned payloadlen; 457 int addrlen; 453 458 int status; 454 459 … … 474 479 /* Get packet from socket. */ 475 480 len = channel->in_pkt_size; 476 status = pj_sock_recv(stream->skinfo.rtp_sock, 477 channel->in_pkt, &len, 0); 481 addrlen = sizeof(stream->rem_src_rtp); 482 status = pj_sock_recvfrom(stream->skinfo.rtp_sock, 483 channel->in_pkt, &len, 0, 484 &stream->rem_src_rtp, &addrlen); 478 485 if (len < 1 || status != PJ_SUCCESS) { 479 486 if (pj_get_netos_error() == PJ_STATUS_FROM_OS(OSERR_ECONNRESET)) { … … 521 528 stream->stat.dec.pkt++; 522 529 stream->stat.dec.bytes += len; 530 531 /* See if source address of RTP packet is different than the 532 * configured address. 533 */ 534 if ((stream->rem_rtp_addr.sin_addr.s_addr != 535 stream->rem_src_rtp.sin_addr.s_addr) || 536 (stream->rem_rtp_addr.sin_port != stream->rem_src_rtp.sin_port)) 537 { 538 stream->rem_src_cnt++; 539 540 if (stream->rem_src_cnt >= PJMEDIA_RTP_NAT_PROBATION_CNT) { 541 542 stream->rem_rtp_addr = stream->rem_src_rtp; 543 stream->rem_src_cnt = 0; 544 545 PJ_LOG(4,(THIS_FILE,"Remote RTP address switched to %s:%d", 546 pj_inet_ntoa(stream->rem_src_rtp.sin_addr), 547 pj_ntohs(stream->rem_src_rtp.sin_port))); 548 } 549 } 523 550 524 551 /* Put to jitter buffer. */
Note: See TracChangeset
for help on using the changeset viewer.