Skip to content

Commit

Permalink
Fix #160. Reset 'targetProfile' when the corresponding profile is rem…
Browse files Browse the repository at this point in the history
…oved
  • Loading branch information
jmillan committed Nov 13, 2017
1 parent 97882cf commit e28738f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions worker/src/RTC/Consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,18 @@ namespace RTC
"profile removed [profile:%s]",
RTC::RtpEncodingParameters::profile2String[profile].c_str());

// No profiles available.
if (this->mapProfileRtpStream.empty())
{
SetEffectiveProfile(RtpEncodingParameters::Profile::NONE);
RecalculateTargetProfile();
}
// If there is an ongoing probation for this profile, disable it.
// Target profile removed. Recalculate.
else if (this->targetProfile == profile)
{
RecalculateTargetProfile();
}
// There is an ongoing probation for this profile, disable it.
else if (this->isProbing && this->probingProfile == profile)
{
// Disable probation flag.
Expand All @@ -337,8 +343,8 @@ namespace RTC

return;
}
// If it is the effective profile, try to downgrade, or upgrade it to the next higher profile if
// the removed profile was lower than other existing ones.
// Effective profile removed. Try to downgrade.
// If there is no profile lower than the removed one then upgrade to the next higher profile.
else if (this->effectiveProfile == profile)
{
SetEffectiveProfile(RtpEncodingParameters::Profile::NONE);
Expand Down

0 comments on commit e28738f

Please sign in to comment.