diff --git a/src/org/jitsi/impl/neomedia/MediaStreamImpl.java b/src/org/jitsi/impl/neomedia/MediaStreamImpl.java index feef7edb024a0cf1e5df69c416acbce2f6769623..e6219a5528aa283218e6746a95bee6cee0d891a1 100644 --- a/src/org/jitsi/impl/neomedia/MediaStreamImpl.java +++ b/src/org/jitsi/impl/neomedia/MediaStreamImpl.java @@ -1694,10 +1694,23 @@ private void start(MediaDirection direction) if (direction == null) throw new NullPointerException("direction"); + /* + * If the local peer is the focus of a conference for which it is to + * perform RTP translation even without generating media to be sent, it + * should create its StreamRTPManager. + */ + boolean getRTPManagerForRTPTranslator = true; + if (direction.allowsSending() && ((startedDirection == null) || !startedDirection.allowsSending())) { + /* + * The startSendStreams method will be called so the getRTPManager + * method will be called as part of the execution of the former. + */ + getRTPManagerForRTPTranslator = false; + startSendStreams(); getDeviceSession().start(MediaDirection.SENDONLY); @@ -1720,6 +1733,12 @@ else if (startedDirection == null) && ((startedDirection == null) || !startedDirection.allowsReceiving())) { + /* + * The startReceiveStreams method will be called so the getRTPManager + * method will be called as part of the execution of the former. + */ + getRTPManagerForRTPTranslator = false; + startReceiveStreams(); getDeviceSession().start(MediaDirection.RECVONLY); @@ -1729,6 +1748,14 @@ else if (startedDirection == null) else if (startedDirection == null) startedDirection = MediaDirection.RECVONLY; } + + /* + * If the local peer is the focus of a conference for which it is to + * perform RTP translation even without generating media to be sent, it + * should create its StreamRTPManager. + */ + if (getRTPManagerForRTPTranslator && (rtpTranslator != null)) + getRTPManager(); } /** @@ -2476,9 +2503,7 @@ private void printFlowStatistics(StreamRTPManager rtpManager) public void setRTPTranslator(RTPTranslator rtpTranslator) { if (this.rtpTranslator != rtpTranslator) - { this.rtpTranslator = rtpTranslator; - } } /** diff --git a/src/org/jitsi/impl/neomedia/RTPTranslatorImpl.java b/src/org/jitsi/impl/neomedia/RTPTranslatorImpl.java index 6aff34c237ead1117118b828c539070fe6c2f88b..bee04eb16fdfd28fcde82f76296c7d8ca5590bbc 100644 --- a/src/org/jitsi/impl/neomedia/RTPTranslatorImpl.java +++ b/src/org/jitsi/impl/neomedia/RTPTranslatorImpl.java @@ -40,6 +40,13 @@ public class RTPTranslatorImpl private static final Logger logger = Logger.getLogger(RTPTranslatorImpl.class); + /** + * The indicator which determines whether the method + * {@link #createFakeSendStreamIfNecessary()} is to be executed by + * <tt>RTPTranslatorImpl</tt>. + */ + private static final boolean CREATE_FAKE_SEND_STREAM_IF_NECESSARY = false; + /** * An array with <tt>long</tt> element type and no elements explicitly * defined to reduce unnecessary allocations. @@ -193,7 +200,8 @@ private synchronized void createFakeSendStreamIfNecessary() * because there is no other remote peer to disperse the received RTP * and RTCP to. */ - if ((fakeSendStream == null) + if (CREATE_FAKE_SEND_STREAM_IF_NECESSARY + && (fakeSendStream == null) && sendStreams.isEmpty() && (streamRTPManagers.size() > 1)) {