Unverified 提交 397e216a authored 作者: José Luis Millán's avatar José Luis Millán 提交者: GitHub

Transport: remove duplicate call to method (#931)

* Transport: remove duplicate call to method

We were calling twice Producer->GetRtcp() and Consumer->GetRtcp().

Those calls were not having any effect because the above methods just return
if they are called before than expected, so the second call had no
effect.
上级 c1f0ce2d
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
### NEXT ### NEXT
* Transport: Remove duplicate call to method (PR #931).
### 3.10.12 ### 3.10.12
......
...@@ -2241,34 +2241,40 @@ namespace RTC ...@@ -2241,34 +2241,40 @@ namespace RTC
for (auto& kv : this->mapConsumers) for (auto& kv : this->mapConsumers)
{ {
auto* consumer = kv.second; auto* consumer = kv.second;
auto rtcpAdded = consumer->GetRtcp(packet.get(), nowMs);
// Send the RTCP compound packet if it's full. // RTCP data couldn't be added because the Compound packet is full.
if (!consumer->GetRtcp(packet.get(), nowMs)) // Send the RTCP compound packet and request for RTCP again.
if (!rtcpAdded)
{ {
SendRtcpCompoundPacket(packet.get()); SendRtcpCompoundPacket(packet.get());
// Create a new compount packet. // Create a new compount packet.
packet.reset(new RTC::RTCP::CompoundPacket()); packet.reset(new RTC::RTCP::CompoundPacket());
}
// Retrieve the RTCP again.
consumer->GetRtcp(packet.get(), nowMs); consumer->GetRtcp(packet.get(), nowMs);
} }
}
for (auto& kv : this->mapProducers) for (auto& kv : this->mapProducers)
{ {
auto* producer = kv.second; auto* producer = kv.second;
auto rtcpAdded = producer->GetRtcp(packet.get(), nowMs);
// Send the RTCP compound packet if it's full. // RTCP data couldn't be added because the Compound packet is full.
if (!producer->GetRtcp(packet.get(), nowMs)) // Send the RTCP compound packet and request for RTCP again.
if (!rtcpAdded)
{ {
SendRtcpCompoundPacket(packet.get()); SendRtcpCompoundPacket(packet.get());
// Create a new compount packet. // Create a new compount packet.
packet.reset(new RTC::RTCP::CompoundPacket()); packet.reset(new RTC::RTCP::CompoundPacket());
}
// Retrieve the RTCP again.
producer->GetRtcp(packet.get(), nowMs); producer->GetRtcp(packet.get(), nowMs);
} }
}
// Send the RTCP compound packet if there is any sender or receiver report. // Send the RTCP compound packet if there is any sender or receiver report.
if (packet->GetReceiverReportCount() > 0u || packet->GetSenderReportCount() > 0u) if (packet->GetReceiverReportCount() > 0u || packet->GetSenderReportCount() > 0u)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论