Index: webrtc/modules/rtp_rtcp/source/ulpfec_receiver_impl.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/ulpfec_receiver_impl.cc b/webrtc/modules/rtp_rtcp/source/ulpfec_receiver_impl.cc |
index dad445dab0e45cd78af7086b7a0f44727e7cc979..d35e71395d833e4f22241e3be5c0f2c6f099c578 100644 |
--- a/webrtc/modules/rtp_rtcp/source/ulpfec_receiver_impl.cc |
+++ b/webrtc/modules/rtp_rtcp/source/ulpfec_receiver_impl.cc |
@@ -21,13 +21,16 @@ |
namespace webrtc { |
-UlpfecReceiver* UlpfecReceiver::Create(RecoveredPacketReceiver* callback) { |
- return new UlpfecReceiverImpl(callback); |
+UlpfecReceiver* UlpfecReceiver::Create(uint32_t ssrc, |
+ RecoveredPacketReceiver* callback) { |
+ return new UlpfecReceiverImpl(ssrc, callback); |
} |
-UlpfecReceiverImpl::UlpfecReceiverImpl(RecoveredPacketReceiver* callback) |
- : recovered_packet_callback_(callback), |
- fec_(ForwardErrorCorrection::CreateUlpfec()) {} |
+UlpfecReceiverImpl::UlpfecReceiverImpl(uint32_t ssrc, |
+ RecoveredPacketReceiver* callback) |
+ : ssrc_(ssrc), |
+ recovered_packet_callback_(callback), |
+ fec_(ForwardErrorCorrection::CreateUlpfec(ssrc_)) {} |
UlpfecReceiverImpl::~UlpfecReceiverImpl() { |
received_packets_.clear(); |
@@ -72,6 +75,12 @@ int32_t UlpfecReceiverImpl::AddReceivedRedPacket( |
const uint8_t* incoming_rtp_packet, |
size_t packet_length, |
uint8_t ulpfec_payload_type) { |
+ if (header.ssrc != ssrc_) { |
+ LOG(LS_INFO) |
holmer
2017/06/28 13:53:06
Should this be a warning?
brandtr_google
2017/06/28 14:01:56
I was thinking that could be a bit spammy. If we r
holmer
2017/06/29 10:50:11
But we don't expect to ever do that, right? I'd wa
brandtr
2017/06/30 08:24:40
Right, this should never happen. Updating the logg
|
+ << "Received RED packet with different SSRC than expected; dropping."; |
+ return -1; |
+ } |
+ |
rtc::CritScope cs(&crit_sect_); |
uint8_t red_header_length = 1; |
@@ -90,6 +99,7 @@ int32_t UlpfecReceiverImpl::AddReceivedRedPacket( |
// Get payload type from RED header and sequence number from RTP header. |
uint8_t payload_type = incoming_rtp_packet[header.headerLength] & 0x7f; |
received_packet->is_fec = payload_type == ulpfec_payload_type; |
+ received_packet->ssrc = header.ssrc; |
received_packet->seq_num = header.sequenceNumber; |
uint16_t block_length = 0; |
@@ -155,6 +165,7 @@ int32_t UlpfecReceiverImpl::AddReceivedRedPacket( |
second_received_packet->pkt = new ForwardErrorCorrection::Packet; |
second_received_packet->is_fec = true; |
+ second_received_packet->ssrc = header.ssrc; |
second_received_packet->seq_num = header.sequenceNumber; |
++packet_counter_.num_fec_packets; |