Skip to content

Commit

Permalink
Fix #492 SimulcastConsumer cannot switch layers if initial tsReferenc…
Browse files Browse the repository at this point in the history
…eSpatialLayer disappears (#1459)
  • Loading branch information
Lynnworld authored Oct 18, 2024
1 parent 173474c commit 22a5f5f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions worker/src/RTC/SimulcastConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,9 @@ namespace RTC
MS_TRACE();

// If we don't have yet a RTP timestamp reference, set it now.
if (newTargetSpatialLayer != -1 && this->tsReferenceSpatialLayer == -1)
if (
newTargetSpatialLayer != -1 && (this->tsReferenceSpatialLayer == -1 ||
!GetProducerTsReferenceRtpStream()->GetSenderReportNtpMs()))
{
MS_DEBUG_TAG(
simulcast, "using spatial layer %" PRIi16 " as RTP timestamp reference", newTargetSpatialLayer);
Expand Down Expand Up @@ -1646,10 +1648,7 @@ namespace RTC
return (
this->tsReferenceSpatialLayer == -1 ||
spatialLayer == this->tsReferenceSpatialLayer ||
(
GetProducerTsReferenceRtpStream()->GetSenderReportNtpMs() &&
this->producerRtpStreams.at(spatialLayer)->GetSenderReportNtpMs()
)
this->producerRtpStreams.at(spatialLayer)->GetSenderReportNtpMs()
);
// clang-format on
}
Expand Down

0 comments on commit 22a5f5f

Please sign in to comment.