Skip to content

VPLAY-10081:Problems with ad progress beacons#782

Merged
pstroffolino merged 2 commits intodev_sprint_25_2from
feature/VPLAY-10081
Jan 21, 2026
Merged

VPLAY-10081:Problems with ad progress beacons#782
pstroffolino merged 2 commits intodev_sprint_25_2from
feature/VPLAY-10081

Conversation

@varshnie
Copy link
Copy Markdown
Contributor

Reason for change:Ad position fix
Test Procedure:Refer Jira Ticket
Risks: Medium

@varshnie varshnie requested a review from a team as a code owner December 19, 2025 14:16
@varshnie varshnie force-pushed the feature/VPLAY-10081 branch 2 times, most recently from 5c727cb to 5e102f3 Compare January 5, 2026 13:53
Copy link
Copy Markdown
Contributor

@Vinish100 Vinish100 left a comment

Choose a reason for hiding this comment

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

Need L1

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request addresses issues with ad progress beacons (VPLAY-10081) by fixing the calculation of ad position timing. The fix ensures that mStartTimeOfFirstPTS is correctly set during ad playback to reflect the actual start time of ads within an ad break.

Key Changes

  • Sets mStartTimeOfFirstPTS to match fragmentTime when playing ads within an ad break (line 7668)
  • Adds logic to calculate mStartTimeOfFirstPTS for ads during discontinuity detection in two separate conditional branches (lines 9331-9339 and 9355-9363)

@varshnie varshnie force-pushed the feature/VPLAY-10081 branch from 5e102f3 to fe46a02 Compare January 6, 2026 10:48
@varshnie varshnie force-pushed the feature/VPLAY-10081 branch from fe46a02 to 1df7952 Compare January 9, 2026 06:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

@varshnie varshnie force-pushed the feature/VPLAY-10081 branch 3 times, most recently from f803381 to 9d69e8e Compare January 13, 2026 06:58
Reason for change:Ad position fix
Test Procedure:Refer Jira Ticket
Risks: Medium

Signed-off-by: varshnie <varshniblue14@gmail.com>
Copilot AI review requested due to automatic review settings January 20, 2026 09:25
@varshnie varshnie force-pushed the feature/VPLAY-10081 branch from 9d69e8e to 299956a Compare January 20, 2026 09:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

pMediaStreamContext->fragmentTime = mPeriodStartTime;
// For playing an ad in a ad break, we should update fragmentTime to PeriodStartTime + basePeriodOffset of ad;
if (mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0 )
if (mCdaiObject && mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The bounds check for mCurAdIdx should include '== 0' case for completeness. The current check 'mCdaiObject->mCurAdIdx > 0' excludes index 0, which may be a valid ad index. Consider whether the bounds check should be 'mCdaiObject->mCurAdIdx >= 0' to include all valid indices, or if index 0 should be excluded with proper documentation explaining why.

Suggested change
if (mCdaiObject && mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0
if (mCdaiObject && mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING

Copilot uses AI. Check for mistakes.
Comment on lines +9401 to +9402
if (mCdaiObject && mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0
&& mCdaiObject->mCurAdIdx < mCdaiObject->mCurAds->size())
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The bounds check for mCurAdIdx should include '== 0' case for completeness. The current check 'mCdaiObject->mCurAdIdx > 0' excludes index 0, which may be a valid ad index. Consider whether the bounds check should be 'mCdaiObject->mCurAdIdx >= 0' to include all valid indices, or if index 0 should be excluded with proper documentation explaining why.

Suggested change
if (mCdaiObject && mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0
&& mCdaiObject->mCurAdIdx < mCdaiObject->mCurAds->size())
if (mCdaiObject && mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING &&
mCdaiObject->mCurAds && mCdaiObject->mCurAdIdx < mCdaiObject->mCurAds->size())

Copilot uses AI. Check for mistakes.
//the periodStartOffset should now be relative to the Availability Start Time.
mMediaStreamContext[i]->periodStartOffset = mPeriodStartTime;
if (mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0)
if (mCdaiObject != nullptr &&mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0)
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Missing space after 'nullptr'. The condition should be formatted as 'mCdaiObject != nullptr && mCdaiObject->mAdState' for consistency with coding style that places spaces around operators.

Suggested change
if (mCdaiObject != nullptr &&mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0)
if (mCdaiObject != nullptr && mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0)

Copilot uses AI. Check for mistakes.
//the periodStartOffset should now be relative to the Availability Start Time.
mMediaStreamContext[i]->periodStartOffset = mPeriodStartTime;
if (mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0)
if (mCdaiObject != nullptr &&mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0)
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The bounds check for mCurAdIdx should include '== 0' case for completeness. The current check 'mCdaiObject->mCurAdIdx > 0' excludes index 0, which may be a valid ad index. Consider whether the bounds check should be 'mCdaiObject->mCurAdIdx >= 0' to include all valid indices, or if index 0 should be excluded with proper documentation explaining why.

Suggested change
if (mCdaiObject != nullptr &&mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0)
if (mCdaiObject != nullptr
&& mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING
&& mCdaiObject->mCurAdIdx >= 0
&& static_cast<size_t>(mCdaiObject->mCurAdIdx) < mCdaiObject->mCurAds->size())

Copilot uses AI. Check for mistakes.
@pstroffolino pstroffolino merged commit 8455be2 into dev_sprint_25_2 Jan 21, 2026
5 of 6 checks passed
@pstroffolino pstroffolino deleted the feature/VPLAY-10081 branch January 21, 2026 18:12
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.

4 participants