[asterisk-scf-commits] asterisk-scf/release/media_rtp_pjmedia.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Sat Jul 23 16:53:21 CDT 2011


branch "master" has been updated
       via  7155270d40bbd3113732b3e3d1e4d0d07bbe8d07 (commit)
       via  ad745a547228db829334d9ef4ef9ec29a8a55b47 (commit)
      from  e84d7465f1cad92a44e5bd5c1391910d3384014e (commit)

Summary of changes:
 src/RTPSink.cpp   |    5 +++--
 src/RTPSource.cpp |    9 +++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 7155270d40bbd3113732b3e3d1e4d0d07bbe8d07
Author: Joshua Colp <jcolp at digium.com>
Date:   Sat Jul 23 18:44:32 2011 -0300

    Fix a bug where the same sink could be added multiple times to a source.

diff --git a/src/RTPSource.cpp b/src/RTPSource.cpp
index 303ef7d..ed3ad97 100644
--- a/src/RTPSource.cpp
+++ b/src/RTPSource.cpp
@@ -114,6 +114,15 @@ void StreamSourceRTPImpl::addSink(const AsteriskSCF::Media::V1::StreamSinkPrx& s
 {
     boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
 
+    // Do not allow the same sink to be added multiple times
+    if (std::find(mImpl->mSourceStateItem->mSinks.begin(),
+                  mImpl->mSourceStateItem->mSinks.end(),
+                  sink) !=
+        mImpl->mSourceStateItem->mSinks.end())
+    {
+        return;
+    }
+
     mImpl->mSourceStateItem->mSinks.push_back(sink);
 
     mImpl->mSessionAdapter->replicateState(mImpl->mSourceStateItem);

commit ad745a547228db829334d9ef4ef9ec29a8a55b47
Author: Joshua Colp <jcolp at digium.com>
Date:   Sat Jul 23 18:44:22 2011 -0300

    Add support for video.

diff --git a/src/RTPSink.cpp b/src/RTPSink.cpp
index 2a54fb3..7d3d07b 100644
--- a/src/RTPSink.cpp
+++ b/src/RTPSink.cpp
@@ -107,9 +107,10 @@ void StreamSinkRTPImpl::write(const AsteriskSCF::Media::V1::FrameSeq& frames, co
     for (FrameSeq::const_iterator frame = frames.begin(); frame != frames.end(); ++frame)
     {
         AudioFormatPtr audioformat;
+        VideoFormatPtr videoformat;
 
-        /* TODO: Add support for other types of media */
-        if (!(audioformat = AudioFormatPtr::dynamicCast((*frame)->mediaFormat)))
+        if (!(audioformat = AudioFormatPtr::dynamicCast((*frame)->mediaFormat)) &&
+            !(videoformat = VideoFormatPtr::dynamicCast((*frame)->mediaFormat)))
         {
             continue;
         }

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


-- 
asterisk-scf/release/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list