Unverified 提交 aa3afdc6 authored 作者: Gustavo Garcia's avatar Gustavo Garcia 提交者: GitHub

Fix marker bit not reseted after mangling in each consumer (#811)

上级 701b62ff
......@@ -602,7 +602,7 @@ namespace RTC
this->payloadDescriptorHandler.reset(payloadDescriptorHandler);
}
bool ProcessPayload(RTC::Codecs::EncodingContext* context);
bool ProcessPayload(RTC::Codecs::EncodingContext* context, bool& marker);
void RestorePayload();
......
......@@ -782,20 +782,15 @@ namespace RTC
return true;
}
bool RtpPacket::ProcessPayload(RTC::Codecs::EncodingContext* context)
bool RtpPacket::ProcessPayload(RTC::Codecs::EncodingContext* context, bool& marker)
{
MS_TRACE();
if (!this->payloadDescriptorHandler)
return true;
bool marker{ false };
if (this->payloadDescriptorHandler->Process(context, this->payload, marker))
{
if (marker)
SetMarker(true);
return true;
}
else
......
......@@ -822,6 +822,8 @@ namespace RTC
this->keyFrameForTsOffsetRequested = false;
}
bool marker{ false };
if (shouldSwitchCurrentSpatialLayer)
{
// Update current spatial layer.
......@@ -841,14 +843,14 @@ namespace RTC
EmitScore();
// Rewrite payload if needed.
packet->ProcessPayload(this->encodingContext.get());
packet->ProcessPayload(this->encodingContext.get(), marker);
}
else
{
auto previousTemporalLayer = this->encodingContext->GetCurrentTemporalLayer();
// Rewrite payload if needed. Drop packet if necessary.
if (!packet->ProcessPayload(this->encodingContext.get()))
if (!packet->ProcessPayload(this->encodingContext.get(), marker))
{
this->rtpSeqManager.Drop(packet->GetSequenceNumber());
......
......@@ -581,7 +581,10 @@ namespace RTC
auto previousSpatialLayer = this->encodingContext->GetCurrentSpatialLayer();
auto previousTemporalLayer = this->encodingContext->GetCurrentTemporalLayer();
if (!packet->ProcessPayload(this->encodingContext.get()))
bool marker{ false };
bool origMarker = packet->HasMarker();
if (!packet->ProcessPayload(this->encodingContext.get(), marker))
{
this->rtpSeqManager.Drop(packet->GetSequenceNumber());
......@@ -612,6 +615,11 @@ namespace RTC
packet->SetSsrc(this->rtpParameters.encodings[0].ssrc);
packet->SetSequenceNumber(seq);
if (marker)
{
packet->SetMarker(true);
}
if (isSyncPacket)
{
MS_DEBUG_TAG(
......@@ -649,6 +657,7 @@ namespace RTC
// Restore packet fields.
packet->SetSsrc(origSsrc);
packet->SetSequenceNumber(origSeq);
packet->SetMarker(origMarker);
// Restore the original payload if needed.
packet->RestorePayload();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论