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

Fix #168. Improve target profile selection in Consumer

上级 bca1a269
......@@ -986,18 +986,23 @@ namespace RTC
// Try with the closest profile to the preferred one.
else
{
auto it = this->mapProfileRtpStream.crbegin();
newTargetProfile = it->first;
auto it = this->mapProfileRtpStream.lower_bound(this->preferredProfile);
for (; it != this->mapProfileRtpStream.crend(); ++it)
// Preferred profile is actually present.
if (it->first == this->preferredProfile)
{
auto profile = it->first;
newTargetProfile = it->first;
}
if (profile <= GetPreferredProfile())
{
newTargetProfile = profile;
break;
}
// The lowest profile is already higher than the preferred. Use it.
else if (it == this->mapProfileRtpStream.begin())
{
newTargetProfile = it->first;
}
// There is a lower profile available. Prefer it over any higher one.
else
{
newTargetProfile = (--it)->first;
}
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论