VPLAY-10081:Problems with ad progress beacons#782
VPLAY-10081:Problems with ad progress beacons#782pstroffolino merged 2 commits intodev_sprint_25_2from
Conversation
5c727cb to
5e102f3
Compare
There was a problem hiding this comment.
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
mStartTimeOfFirstPTSto matchfragmentTimewhen playing ads within an ad break (line 7668) - Adds logic to calculate
mStartTimeOfFirstPTSfor ads during discontinuity detection in two separate conditional branches (lines 9331-9339 and 9355-9363)
5e102f3 to
fe46a02
Compare
fe46a02 to
1df7952
Compare
f803381 to
9d69e8e
Compare
Reason for change:Ad position fix Test Procedure:Refer Jira Ticket Risks: Medium Signed-off-by: varshnie <varshniblue14@gmail.com>
9d69e8e to
299956a
Compare
| 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 |
There was a problem hiding this comment.
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.
| if (mCdaiObject && mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0 | |
| if (mCdaiObject && mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING |
| if (mCdaiObject && mCdaiObject->mAdState == AdState::IN_ADBREAK_AD_PLAYING && mCdaiObject->mCurAdIdx > 0 | ||
| && mCdaiObject->mCurAdIdx < mCdaiObject->mCurAds->size()) |
There was a problem hiding this comment.
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.
| 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()) |
| //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) |
There was a problem hiding this comment.
Missing space after 'nullptr'. The condition should be formatted as 'mCdaiObject != nullptr && mCdaiObject->mAdState' for consistency with coding style that places spaces around operators.
| 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) |
| //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) |
There was a problem hiding this comment.
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.
| 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()) |
Reason for change:Ad position fix
Test Procedure:Refer Jira Ticket
Risks: Medium