[asterisk-scf-commits] asterisk-scf/integration/media_rtp_pjmedia.git branch "modular-transport-refactor" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Jun 15 07:43:04 CDT 2011


branch "modular-transport-refactor" has been updated
       via  22c77cd865f76c6a2270860cf763301acf70b401 (commit)
      from  9c579d66b9af6d7193445ac2d63a7f1340b98150 (commit)

Summary of changes:
 src/RTPSink.cpp |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)


- Log -----------------------------------------------------------------
commit 22c77cd865f76c6a2270860cf763301acf70b401
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Jun 15 10:11:48 2011 -0230

    Fix non-initialized member bugs found in sink impl by unit test.

diff --git a/src/RTPSink.cpp b/src/RTPSink.cpp
index 3cb981a..929e129 100644
--- a/src/RTPSink.cpp
+++ b/src/RTPSink.cpp
@@ -216,8 +216,12 @@ void StreamSinkRTPImpl::setRemoteDetails(const string& address, Ice::Int port, c
  */
 std::string StreamSinkRTPImpl::getRemoteAddress(const Ice::Current&)
 {
-    string address = mImpl->mTransport->remoteAddress()->hostname();
-    return (address != "0.0.0.0") ? address : mImpl->mSinkStateItem->mRemoteAddress;
+    if (mImpl->mTransport && mImpl->mTransport->remoteAddress())
+    {
+        string address = mImpl->mTransport->remoteAddress()->hostname();
+        return (address != "0.0.0.0") ? address : mImpl->mSinkStateItem->mRemoteAddress;
+    }
+    return mImpl->mSinkStateItem->mRemoteAddress;
 }
 
 /**
@@ -225,8 +229,12 @@ std::string StreamSinkRTPImpl::getRemoteAddress(const Ice::Current&)
  */
 Ice::Int StreamSinkRTPImpl::getRemotePort(const Ice::Current&)
 {
-    int port = mImpl->mTransport->remoteAddress()->port();
-    return (port != 0) ? port : mImpl->mSinkStateItem->mRemotePort;
+    if (mImpl->mTransport && mImpl->mTransport->remoteAddress())
+    {
+        int port = mImpl->mTransport->remoteAddress()->port();
+        return (port != 0) ? port : mImpl->mSinkStateItem->mRemotePort;
+    }
+    return mImpl->mSinkStateItem->mRemotePort;
 }
 
 /**

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list