Source:
<code>private int doWrite( byte[] buf, int off, int len, Format format, StreamRTPManagerDesc exclusion) { int seqno = RawPacket.getSequenceNumber(buf, off, len); RTPTranslatorImpl translator = getTranslator(); if (translator == null) return 0; List<OutputDataStreamDesc> streams = _streams; boolean removeRTPHeaderExtensions = _removeRTPHeaderExtensions; int written = 0; for (int i = 0, end = streams.size(); i < end; ++i) { OutputDataStreamDesc s = streams.get(i); StreamRTPManagerDesc streamRTPManager = s.connectorDesc.streamRTPManagerDesc; RawPacket.setSequenceNumber(buf, off, seqno); if (streamRTPManager == exclusion) continue; boolean write; if (_data) { if (removeRTPHeaderExtensions) { removeRTPHeaderExtensions = false; len = removeRTPHeaderExtensions(buf, off, len); } write = willWriteData( streamRTPManager, buf, off, len, format, exclusion); } else { write = willWriteControl( streamRTPManager, buf, off, len, format, exclusion); } if (write) { write = translator.willWrite( exclusion, buf, off, len, streamRTPManager, _data); } <START> Long ssrc = RawPacket.getSSRCAsLong(buf, off, len); <END> SequenceNumberRewriter rewriter = s.ssrcToRewriter.get(ssrc); if (rewriter == null) { rewriter = new SequenceNumberRewriter(); s.ssrcToRewriter.put(ssrc, rewriter); } rewriter.rewrite(write, buf, off, len); if (!write) continue; int w = s.stream.write(buf, off, len); if (written < w) written = w; } return written; }</code><technical_language>This code executes for RTCP well. I suspect worked major issues, this quickly fill map getSSRCAsLong read NTP timestamp if packet is RTCP, changes packet</technical_language>

Target:
private int doWrite( byte[] buf, int off, int len, Format format, StreamRTPManagerDesc exclusion) { int originalSequenceNumber = RawPacket.getSequenceNumber(buf, off, len); RTPTranslatorImpl translator = getTranslator(); if (translator == null) return 0; List<OutputDataStreamDesc> streams = _streams; boolean removeRTPHeaderExtensions = _removeRTPHeaderExtensions; int written = 0; for (int i = 0, end = streams.size(); i < end; ++i) { OutputDataStreamDesc s = streams.get(i); StreamRTPManagerDesc streamRTPManager = s.connectorDesc.streamRTPManagerDesc; if (streamRTPManager == exclusion) continue; boolean write; if (_data) { if (removeRTPHeaderExtensions) { removeRTPHeaderExtensions = false; len = removeRTPHeaderExtensions(buf, off, len); } write = willWriteData( streamRTPManager, buf, off, len, format, exclusion); } else { write = willWriteControl( streamRTPManager, buf, off, len, format, exclusion); } if (write) { write = translator.willWrite( exclusion, buf, off, len, streamRTPManager, _data); } boolean altered = false; if (_data) { Long ssrc = RawPacket.getSSRCAsLong(buf, off, len); SequenceNumberRewriter rewriter = streamRTPManager.streamRTPManager.ssrcToRewriter.get(ssrc); if (rewriter == null) { rewriter = new SequenceNumberRewriter(); streamRTPManager .streamRTPManager.ssrcToRewriter.put(ssrc, rewriter); } altered = rewriter.rewrite(write, buf, off, len); } if (write) { int w = s.stream.write(buf, off, len); if (written < w) written = w; } if (altered) { RawPacket .setSequenceNumber(buf, off, originalSequenceNumber); } } return written; }