-
Notifications
You must be signed in to change notification settings - Fork 6
VPLAY-11600 IsEmptyPeriod() with checkIframe=false when using AAMP TSB #725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev_sprint_25_2
Are you sure you want to change the base?
Conversation
Reason for Change: This needs fixing before we can fix VPLAY-11583 Summary of Changes: * Call IsEmptyPeriod() with checkIframe=false for AAMP TSB * Use aamp->rate instead of rate in IsEmptyPeriod() * Improve comments and parameters name for GetPeriodDuration() and GetPeriodEndTime() Test Procedure: Verify no regressions when using AAMP TSB Risk: Low Signed-off-by: Jose Fagundez <[email protected]>
There was a problem hiding this 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 PR refactors the logic for checking empty periods in MPEG-DASH playback to support AAMP TSB (Time Shift Buffer) functionality. The key change introduces two new helper functions that centralize the decision of whether to check only iframe adaptations when determining if a period is empty. When using local AAMP TSB, the code now checks all adaptations regardless of playback rate, since the iframe track is not used in TSB mode.
Key Changes:
- Added
ShouldCheckOnlyIframeAdaptation()helper to encapsulate the logic for determining whether to check only iframe adaptations based on playback rate and TSB mode - Added
IsEmptyPeriod()wrapper that uses the new helper to call the underlying MPD parse helper - Replaced 30+ call sites throughout
fragmentcollector_mpd.cppto use the new centralized functions
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| fragmentcollector_mpd.h | Added declarations for two new helper functions: ShouldCheckOnlyIframeAdaptation() and IsEmptyPeriod() |
| fragmentcollector_mpd.cpp | Implemented the two new helper functions and refactored all call sites to use them instead of inline checks, centralizing TSB-aware logic |
| AampMPDParseHelper.h | Improved documentation for GetPeriodDuration(), GetPeriodEndTime(), and UpdateBoundaryPeriod() with detailed parameter descriptions |
| AampMPDParseHelper.cpp | Updated documentation for UpdateBoundaryPeriod() and GetPeriodEndTime() to clarify parameter meanings |
Address review comments made by Copilot Co-authored-by: Copilot <[email protected]>
There was a problem hiding this 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 4 out of 4 changed files in this pull request and generated 1 comment.
Address review comment made by Copilot Co-authored-by: Copilot <[email protected]>
There was a problem hiding this 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 4 out of 4 changed files in this pull request and generated 6 comments.
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this 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 4 out of 4 changed files in this pull request and generated 2 comments.
| bool StreamAbstractionAAMP_MPD::ShouldCheckOnlyIframeAdaptation() const | ||
| { | ||
| // If playing at normal rate, check all adaptations. | ||
| // For trick modes, check only iframe adaptations (unless using AAMP TSB) | ||
| bool checkOnlyIframeAdaptation = (aamp->rate != AAMP_NORMAL_PLAY_RATE); | ||
|
|
||
| // When using local AAMP TSB, i/frame track is not used, | ||
| // so check all adaptations regardless of playback rate. | ||
| if (aamp->IsLocalAAMPTsb()) | ||
| { | ||
| checkOnlyIframeAdaptation = false; | ||
| } | ||
|
|
||
| return checkOnlyIframeAdaptation; |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ShouldCheckOnlyIframeAdaptation() helper uses aamp->rate directly, which differs from the original behavior that captured currentRate at the start of Init() (line 3198) and used that snapshot throughout the function. This change means the rate is now evaluated dynamically on each call rather than using a consistent snapshot.
If aamp->rate can change during the execution of Init() or other methods, this could lead to inconsistent behavior where different calls to IsEmptyPeriod() or GetPeriodDuration() within the same method use different rate values.
Consider one of these approaches:
- If the rate is guaranteed not to change during these operations, document this assumption clearly
- If the rate can change, restore the original behavior by passing the rate as a parameter to the helper functions
- Add synchronization to ensure consistent rate evaluation
Since this affects TSB behavior (the primary purpose of this PR), this behavioral change should be explicitly validated.
| bool StreamAbstractionAAMP_MPD::ShouldCheckOnlyIframeAdaptation() const | ||
| { | ||
| // If playing at normal rate, check all adaptations. | ||
| // For trick modes, check only iframe adaptations (unless using AAMP TSB) | ||
| bool checkOnlyIframeAdaptation = (aamp->rate != AAMP_NORMAL_PLAY_RATE); | ||
|
|
||
| // When using local AAMP TSB, i/frame track is not used, | ||
| // so check all adaptations regardless of playback rate. | ||
| if (aamp->IsLocalAAMPTsb()) | ||
| { | ||
| checkOnlyIframeAdaptation = false; | ||
| } | ||
|
|
||
| return checkOnlyIframeAdaptation; | ||
| } | ||
|
|
||
| /** | ||
| * @fn IsEmptyPeriod | ||
| * @param[in] iPeriodIndex Index of the period to check whether it is empty | ||
| * @retval Return true on empty Period | ||
| */ | ||
| bool StreamAbstractionAAMP_MPD::IsEmptyPeriod(int iPeriodIndex) const | ||
| { | ||
| return mMPDParseHelper->IsEmptyPeriod(iPeriodIndex, ShouldCheckOnlyIframeAdaptation()); | ||
| } |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new helper functions ShouldCheckOnlyIframeAdaptation() and IsEmptyPeriod() lack test coverage. Given that:
- These functions encapsulate critical TSB-specific logic
- The PR description states "Change necessary prior to fixing VPLAY-11583"
- Similar components like
AampTsbReader,AampTsbDataManagerhave comprehensive test coverage intest/utests/tests/
Unit tests should be added to verify:
- Normal playback rate returns false for
ShouldCheckOnlyIframeAdaptation() - Trick mode (non-normal rate) returns true when not using AAMP TSB
- AAMP TSB mode always returns false regardless of rate
IsEmptyPeriod()correctly delegates tomMPDParseHelper->IsEmptyPeriod()with the right parameter
Reason for Change: Change necessary prior to fixing VPLAY-11583
Summary of Changes:
which returns false for AAMP TSB
Test Procedure: No regressions with AAMP TSB
Risk: Low