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 @@
### NEXT
* Transport: Remove duplicate call to method (PR #931).
### 3.10.12
......
......@@ -2241,33 +2241,39 @@ namespace RTC
for (auto& kv : this->mapConsumers)
{
auto* consumer = kv.second;
auto rtcpAdded = consumer->GetRtcp(packet.get(), nowMs);
// Send the RTCP compound packet if it's full.
if (!consumer->GetRtcp(packet.get(), nowMs))
// RTCP data couldn't be added because the Compound packet is full.
// Send the RTCP compound packet and request for RTCP again.
if (!rtcpAdded)
{
SendRtcpCompoundPacket(packet.get());
// Create a new compount packet.
packet.reset(new RTC::RTCP::CompoundPacket());
}
consumer->GetRtcp(packet.get(), nowMs);
// Retrieve the RTCP again.
consumer->GetRtcp(packet.get(), nowMs);
}
}
for (auto& kv : this->mapProducers)
{
auto* producer = kv.second;
auto rtcpAdded = producer->GetRtcp(packet.get(), nowMs);
// Send the RTCP compound packet if it's full.
if (!producer->GetRtcp(packet.get(), nowMs))
// RTCP data couldn't be added because the Compound packet is full.
// Send the RTCP compound packet and request for RTCP again.
if (!rtcpAdded)
{
SendRtcpCompoundPacket(packet.get());
// Create a new compount packet.
packet.reset(new RTC::RTCP::CompoundPacket());
}
producer->GetRtcp(packet.get(), nowMs);
// Retrieve the RTCP again.
producer->GetRtcp(packet.get(), nowMs);
}
}
// Send the RTCP compound packet if there is any sender or receiver report.
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论