diff --git a/src/modules/video_coding/main/source/media_opt_util.cc b/src/modules/video_coding/main/source/media_opt_util.cc index da516ba23c..03cbf77901 100644 --- a/src/modules/video_coding/main/source/media_opt_util.cc +++ b/src/modules/video_coding/main/source/media_opt_util.cc @@ -844,42 +844,14 @@ VCMLossProtectionLogic::UpdateMethod(VCMProtectionMethod *newMethod /*=NULL */) _currentParameters.codecWidth = _codecWidth; _currentParameters.codecHeight = _codecHeight; - if (newMethod == NULL) + // Update to new method, if not NULL + if (newMethod != NULL) { - VCMProtectionMethod *method; - ListItem *item; - for (item = _availableMethods.First(); item != NULL; - item = _availableMethods.Next(item)) - { - method = static_cast (item->GetItem()); - if (method != NULL) - { - if (method->Type() == kFEC) - { - _selectedMethod = method; - } - if (method->Type() == kNACK) - { - _selectedMethod = method; - } - if (method->Type() == kNackFec) - { - _selectedMethod = method; - } - method->UpdateParameters(&_currentParameters); - } - } - if (_selectedMethod != NULL && _selectedMethod->Type() != kFEC) - { - _selectedMethod = method; - } - } - else - { - _selectedMethod = newMethod; - _selectedMethod->UpdateParameters(&_currentParameters); - } - return true; + _selectedMethod = newMethod; + _selectedMethod->UpdateParameters(&_currentParameters); + return true; + } + return false; } VCMProtectionMethod* diff --git a/src/modules/video_coding/main/source/media_opt_util.h b/src/modules/video_coding/main/source/media_opt_util.h index ce74e67bf3..212dc77636 100644 --- a/src/modules/video_coding/main/source/media_opt_util.h +++ b/src/modules/video_coding/main/source/media_opt_util.h @@ -339,8 +339,7 @@ public: _fecRateDelta = fecRateDelta; } // Update the protection methods with the current VCMProtectionParameters - // and choose the best method available. The update involves computing the - // robustness settings for the protection method. + // and set the requested protection settings. // // Input: // - newMethod : If not NULL, this method will be selected.