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

Consumer: Apply RTP Timestamp offset when sync-ing

上级 36d8f694
...@@ -494,13 +494,17 @@ namespace RTC ...@@ -494,13 +494,17 @@ namespace RTC
isSyncPacket = true; isSyncPacket = true;
this->rtpSeqManager.Sync(packet->GetSequenceNumber()); this->rtpSeqManager.Sync(packet->GetSequenceNumber());
this->rtpTimestampManager.Sync(packet->GetTimestamp());
// Calculate RTP timestamp diff between now and last sent RTP packet. // Calculate RTP timestamp diff between now and last sent RTP packet.
if (this->rtpStream->GetMaxPacketMs())
{
auto now = DepLibUV::GetTime(); auto now = DepLibUV::GetTime();
auto diffMs = now - this->rtpStream->GetMaxPacketMs(); auto diffMs = now - this->rtpStream->GetMaxPacketMs();
auto diffTs = diffMs * this->rtpStream->GetClockRate() / 1000; auto diffTs = diffMs * this->rtpStream->GetClockRate() / 1000;
this->rtpTimestampManager.Sync(packet->GetTimestamp() + diffTs); this->rtpTimestampManager.Offset(diffTs);
}
this->syncRequired = false; this->syncRequired = false;
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论