提交 5192c822 authored 作者: José Luis Millán's avatar José Luis Millán

RTCP: Do not generate SR if no RTP was sent within the last 250ms

上级 e6b1ad8a
...@@ -292,6 +292,12 @@ namespace RTC ...@@ -292,6 +292,12 @@ namespace RTC
// Calculate RTP timestamp diff between now and last received RTP packet. // Calculate RTP timestamp diff between now and last received RTP packet.
auto diffMs = static_cast<int64_t>(now - this->maxPacketMs); auto diffMs = static_cast<int64_t>(now - this->maxPacketMs);
// Do not generate SR if no RTP was sent within the last 250ms
// not to pollute the RTP Timestamp seen by the receiver.
if (diffMs > 250)
return nullptr;
int64_t diffTs = diffMs * this->params.clockRate / 1000; int64_t diffTs = diffMs * this->params.clockRate / 1000;
// Get the NTP representation of the current timestamp. // Get the NTP representation of the current timestamp.
auto ntp = Utils::Time::TimeMs2Ntp(now); auto ntp = Utils::Time::TimeMs2Ntp(now);
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论