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

Fix #188. Increase profiles one by one unless explicitly forced

上级 b7217f00
...@@ -907,12 +907,15 @@ namespace RTC ...@@ -907,12 +907,15 @@ namespace RTC
// Downgrade the target profile. // Downgrade the target profile.
newTargetProfile = (std::prev(it))->first; newTargetProfile = (std::prev(it))->first;
} }
// If there is no preferred profile, get the highest one. // If there is no preferred profile, get the next higher one available.
else if (GetPreferredProfile() == RTC::RtpEncodingParameters::Profile::DEFAULT) else if (GetPreferredProfile() == RTC::RtpEncodingParameters::Profile::DEFAULT)
{ {
auto it = this->mapProfileRtpStream.crbegin(); auto it = this->mapProfileRtpStream.upper_bound(this->effectiveProfile);
if (it != this->mapProfileRtpStream.end())
newTargetProfile = it->first; newTargetProfile = it->first;
else
newTargetProfile = this->effectiveProfile;
} }
// Try with the closest profile to the preferred one. // Try with the closest profile to the preferred one.
else else
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论