VPAAMP-342 add enabled guard to HandleSeekEOSAndPeriodTransition EOS …#1453
Open
pstroffolino wants to merge 1 commit into
Open
VPAAMP-342 add enabled guard to HandleSeekEOSAndPeriodTransition EOS …#1453pstroffolino wants to merge 1 commit into
pstroffolino wants to merge 1 commit into
Conversation
…check A disabled track (deselected audio, inactive subtitle) must not drive a forward period transition. The EOS check loop in HandleSeekEOSAndPeriodTransition now requires mMediaStreamContext[i]->enabled in addition to the existing NULL and mPlayRate guards. Without this guard, a track whose context is non-NULL but whose enabled flag is false (e.g. during a mid-playback audio track switch, or when no subtitle stream is active) could set switchToNextPeriod=true and advance the period index spuriously. Unit test: HandleSeekEOS_DisabledTrack_NoPeriodTransition verifies that disabled+eos tracks return false / leave period index unchanged.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a DASH multi-period seek edge case in StreamAbstractionAAMP_MPD: a disabled (deselected) track must not be allowed to trigger a forward period transition solely due to its EOS flag. It adds an enabled guard to the EOS scan in HandleSeekEOSAndPeriodTransition and introduces a unit test to prevent regression.
Changes:
- Update
HandleSeekEOSAndPeriodTransitionto only consider EOS fromenabledtracks when deciding to advance to the next period. - Add an L1 unit test to verify no period transition occurs when EOS is set only on disabled track contexts.
- Add small test-only helpers to access/drive the private method and track contexts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
fragmentcollector_mpd.cpp |
Adds mMediaStreamContext[i]->enabled to the EOS-to-period-transition decision and updates the accompanying comment for the new semantics. |
test/utests/tests/StreamAbstractionAAMP_MPD/FetcherLoopTests.cpp |
Adds a regression test and test-only helper accessors to invoke HandleSeekEOSAndPeriodTransition and manipulate track contexts. |
| } | ||
|
|
||
| MediaStreamContext* GetMediaStreamContextAt(int idx) | ||
| { |
Comment on lines
+2663
to
+2666
| * transition when the only EOS-flagged track is disabled. | ||
| * | ||
| * Scenario: after init at period 0, mark the video track disabled and set its eos flag. | ||
| * Call HandleSeekEOSAndPeriodTransition with a non-negative remainingSeek. |
| for (int i = 0; i < mNumberOfTracks; i++) | ||
| { | ||
| if (mMediaStreamContext[i] != NULL && mMediaStreamContext[i]->eos && (mPlayRate >= AAMP_RATE_PAUSE) && remainingSeek >= 0) | ||
| if (mMediaStreamContext[i] != NULL && mMediaStreamContext[i]->enabled && mMediaStreamContext[i]->eos && (mPlayRate >= AAMP_RATE_PAUSE) && remainingSeek >= 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…check
A disabled track (deselected audio, inactive subtitle) must not drive a forward period transition. The EOS check loop in
HandleSeekEOSAndPeriodTransition now requires mMediaStreamContext[i]->enabled in addition to the existing NULL and mPlayRate guards.
Without this guard, a track whose context is non-NULL but whose enabled flag is false (e.g. during a mid-playback audio track switch, or when no subtitle stream is active) could set switchToNextPeriod=true and advance the period index spuriously.
Unit test: HandleSeekEOS_DisabledTrack_NoPeriodTransition verifies that disabled+eos tracks return false / leave period index unchanged.