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

RtpStreamSend: Adjust RTP Timestamp in RTCP Sender Reports

上级 8e85ec77
...@@ -172,10 +172,14 @@ namespace RTC ...@@ -172,10 +172,14 @@ namespace RTC
auto ntp = Utils::Time::TimeMs2Ntp(now); auto ntp = Utils::Time::TimeMs2Ntp(now);
auto report = new RTC::RTCP::SenderReport(); auto report = new RTC::RTCP::SenderReport();
// Calculate TS difference between now and maxPacketMs.
auto diffMs = now - this->maxPacketMs;
auto diffTs = diffMs * this->GetClockRate() / 1000;
report->SetSsrc(GetSsrc()); report->SetSsrc(GetSsrc());
report->SetPacketCount(this->transmissionCounter.GetPacketCount()); report->SetPacketCount(this->transmissionCounter.GetPacketCount());
report->SetOctetCount(this->transmissionCounter.GetBytes()); report->SetOctetCount(this->transmissionCounter.GetBytes());
report->SetRtpTs(this->maxPacketTs); report->SetRtpTs(this->maxPacketTs + diffTs);
report->SetNtpSec(ntp.seconds); report->SetNtpSec(ntp.seconds);
report->SetNtpFrac(ntp.fractions); report->SetNtpFrac(ntp.fractions);
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论