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

Producer: remove stream from active stream map when inactive

上级 b030ea7e
...@@ -671,7 +671,7 @@ namespace RTC ...@@ -671,7 +671,7 @@ namespace RTC
{ {
MS_ASSERT( MS_ASSERT(
this->mapActiveProfiles.find(profile) == this->mapActiveProfiles.end(), this->mapActiveProfiles.find(profile) == this->mapActiveProfiles.end(),
"profile already in headltyProfiles set"); "profile already in active profiles map");
// Add the profile to the active profiles map. // Add the profile to the active profiles map.
this->mapActiveProfiles[profile] = rtpStream; this->mapActiveProfiles[profile] = rtpStream;
...@@ -692,7 +692,7 @@ namespace RTC ...@@ -692,7 +692,7 @@ namespace RTC
{ {
MS_ASSERT( MS_ASSERT(
this->mapActiveProfiles.find(profile) != this->mapActiveProfiles.end(), this->mapActiveProfiles.find(profile) != this->mapActiveProfiles.end(),
"profile not in headltyProfiles"); "profile not in active profiles map");
// Remove the profile from the active profiles map. // Remove the profile from the active profiles map.
this->mapActiveProfiles.erase(profile); this->mapActiveProfiles.erase(profile);
...@@ -802,15 +802,27 @@ namespace RTC ...@@ -802,15 +802,27 @@ namespace RTC
if (totalBitrate == 0) if (totalBitrate == 0)
return; return;
// Simulcast. Remove the stream from active profiles. // Check whether the stream is already active.
MS_DEBUG_TAG(rtp, "rtp inactivity detected [ssrc:%" PRIu32, rtpStream->GetSsrc()); const RtpStream* activeRtpStream = nullptr;
for (auto it : this->mapActiveProfiles)
{
activeRtpStream = it.second;
// Remove stream from the active profiles map.
if (activeRtpStream == rtpStream)
{
MS_DEBUG_TAG(rtp, "rtp inactivity detected [ssrc:%" PRIu32 "]", rtpStream->GetSsrc());
RemoveActiveProfiles(rtpStreamRecv); RemoveActiveProfiles(rtpStreamRecv);
break;
}
}
// Reset stream check timer on every active stream. // Reset stream check timer on every active stream.
for (auto it : this->mapActiveProfiles) for (auto it : this->mapActiveProfiles)
{ {
auto activeRtpStream = it.second; activeRtpStream = it.second;
auto ssrc = activeRtpStream->GetSsrc(); auto ssrc = activeRtpStream->GetSsrc();
this->rtpStreams[ssrc]->ResetStatusCheckTimer(RTC::RtpStream::StatusCheckPeriod * 2); this->rtpStreams[ssrc]->ResetStatusCheckTimer(RTC::RtpStream::StatusCheckPeriod * 2);
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论