summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-09-14 18:51:01 +0000
committerBenny Prijono <bennylp@teluu.com>2006-09-14 18:51:01 +0000
commitb6b613a4e59e2177a2e899dc4e21ab660c05de3d (patch)
treeab3821c5de8972a5006c4590ec631ff40ef61e15 /pjmedia
parente015ebe064c6f5120ef2af2b73ce52796a06f790 (diff)
Fix the local IP address resolution issue in PJSIP, PJMEDIA, and PJSUA, by adding a new API pj_gethostip() to resolve the default local IP address of local host. This new function will work even when local hostname resolution is not set correctly, by detecting the default IP interface in the system.
Also fix compile warnings in iLBC. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@721 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r--pjmedia/src/pjmedia-codec/ilbc/iCBSearch.c6
-rw-r--r--pjmedia/src/pjmedia/transport_udp.c12
2 files changed, 10 insertions, 8 deletions
diff --git a/pjmedia/src/pjmedia-codec/ilbc/iCBSearch.c b/pjmedia/src/pjmedia-codec/ilbc/iCBSearch.c
index 0f65e449..dfbc50b7 100644
--- a/pjmedia/src/pjmedia-codec/ilbc/iCBSearch.c
+++ b/pjmedia/src/pjmedia-codec/ilbc/iCBSearch.c
@@ -127,7 +127,8 @@
*ppe=0.0;
pp=buf+LPC_FILTERORDER+lMem-lTarget;
for (j=0; j<lTarget; j++) {
- *ppe+=(*pp)*(*pp++);
+ *ppe+=(*pp)*(*pp);
+ ++pp;
}
if (*ppe>0.0) {
@@ -322,7 +323,8 @@
pp=cbvectors+lMem-lTarget;
for (j=0; j<lTarget; j++) {
- *ppe+=(*pp)*(*pp++);
+ *ppe+=(*pp)*(*pp);
+ ++pp;
}
ppi = cbvectors + lMem - 1 - lTarget;
diff --git a/pjmedia/src/pjmedia/transport_udp.c b/pjmedia/src/pjmedia/transport_udp.c
index a92c3edb..be67cfae 100644
--- a/pjmedia/src/pjmedia/transport_udp.c
+++ b/pjmedia/src/pjmedia/transport_udp.c
@@ -245,13 +245,13 @@ PJ_DEF(pj_status_t) pjmedia_transport_udp_attach( pjmedia_endpt *endpt,
/* If address is 0.0.0.0, use host's IP address */
if (tp->rtp_addr_name.sin_addr.s_addr == 0) {
- pj_hostent he;
- const pj_str_t *hostname = pj_gethostname();
- status = pj_gethostbyname(hostname, &he);
- if (status != PJ_SUCCESS) {
+ pj_in_addr hostip;
+
+ status = pj_gethostip(&hostip);
+ if (status != PJ_SUCCESS)
goto on_error;
- }
- tp->rtp_addr_name.sin_addr = *(pj_in_addr*)he.h_addr;
+
+ tp->rtp_addr_name.sin_addr = hostip;
}
/* Same with RTCP */