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

Producer: ClearRtpStreams cleanup

上级 9d25597f
......@@ -560,8 +560,6 @@ namespace RTC
// Remove the profiles related to this stream from active profiles map and notify the listener.
DeactivateStreamProfiles(rtpStream);
this->rtpStreams.erase(rtpStream->GetSsrc());
for (auto& kv : this->mapRtxStreams)
{
auto rtxSsrc = kv.first;
......@@ -584,34 +582,18 @@ namespace RTC
{
MS_TRACE();
for (auto& kv : this->rtpStreams)
auto it = this->rtpStreams.begin();
while (it != this->rtpStreams.end())
{
auto rtpStream = kv.second;
auto rtpStream = it->second;
delete rtpStream;
ClearRtpStream(rtpStream);
it = this->rtpStreams.erase(it);
}
this->rtpStreams.clear();
this->mapRtxStreams.clear();
// Notify about all profiles being disabled.
for (auto& kv : this->mapRtpStreamProfiles)
{
auto& profiles = kv.second;
for (auto profile : profiles)
{
// Don't announce default profile, but just those for simulcast/SVC.
if (profile == RTC::RtpEncodingParameters::Profile::DEFAULT)
break;
for (auto& listener : this->listeners)
{
listener->OnProducerProfileDisabled(this, profile);
}
}
}
this->mapRtpStreamProfiles.clear();
this->mapActiveProfiles.clear();
}
......@@ -701,6 +683,10 @@ namespace RTC
// Remove the profile from the active profiles map.
this->mapActiveProfiles.erase(profile);
// Don't announce default profile, but just those for simulcast/SVC.
if (profile == RTC::RtpEncodingParameters::Profile::DEFAULT)
break;
for (auto& listener : this->listeners)
{
listener->OnProducerProfileDisabled(this, profile);
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论