@@ -319,12 +319,18 @@ namespace RTC
319
319
" profile removed [profile:%s]" ,
320
320
RTC::RtpEncodingParameters::profile2String[profile].c_str ());
321
321
322
+ // No profiles available.
322
323
if (this ->mapProfileRtpStream .empty ())
323
324
{
324
325
SetEffectiveProfile (RtpEncodingParameters::Profile::NONE);
325
326
RecalculateTargetProfile ();
326
327
}
327
- // If there is an ongoing probation for this profile, disable it.
328
+ // Target profile removed. Recalculate.
329
+ else if (this ->targetProfile == profile)
330
+ {
331
+ RecalculateTargetProfile ();
332
+ }
333
+ // There is an ongoing probation for this profile, disable it.
328
334
else if (this ->isProbing && this ->probingProfile == profile)
329
335
{
330
336
// Disable probation flag.
@@ -337,8 +343,8 @@ namespace RTC
337
343
338
344
return ;
339
345
}
340
- // If it is the effective profile, try to downgrade, or upgrade it to the next higher profile if
341
- // the removed profile was lower than other existing ones .
346
+ // Effective profile removed. Try to downgrade.
347
+ // If there is no profile lower than the removed one then upgrade to the next higher profile .
342
348
else if (this ->effectiveProfile == profile)
343
349
{
344
350
SetEffectiveProfile (RtpEncodingParameters::Profile::NONE);
0 commit comments