Skip to content

Conversation

Reshma-JO07
Copy link

Reason for change: Added an api in ABRManager
to get the lowest bandwidth index
Test Procedure: Updated in ticket
Risks: Medium

@Reshma-JO07 Reshma-JO07 requested review from a team as code owners September 3, 2025 06:44
if (bufferValue == 0 || bufferValue > mABRMaxBuffer)
if ((int)bufferValue == 0)
{
AAMPLOG_WARN("rampDown to lowest profile");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Attempting rampdown to lowest profile as buffer is 0" would be good

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

std::lock_guard<std::mutex> lock(mProfileLock);
int profileCount = getProfileCountUnlocked();
PROFILES_EMPTY_CHECK_RET(profileCount, 0);
auto it = min_element(mProfiles.begin(), mProfiles.end(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix indentation. Isn't it better to get the first element from the sortedbandwidth data structure?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is fixed and made changes to read from sortedbandwidth data structure

firstBW = innerIter->first;
index = innerIter->second;
}
return index;
Copy link

@rdkcmf-jenkins rdkcmf-jenkins Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverity issue no longer present as of: undefined

Show issue

Coverity Issue - Uninitialized scalar variable

Using uninitialized value "index".

High Impact, CWE-457
UNINIT

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please write optimized code..
firstBW is not used at all, so what's the point of having that variable
auto &profileMap = mSortedBWProfileList.begin()->second;
if (!profileMap.empty()) { index = profileMap.begin()->second;}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.Done

Reason for change: Added an api in ABRManager
to get the lowest bandwidth index
Test Procedure: Updated in ticket
Risks: Medium

Signed-off-by: Reshma-JO07 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants