Skip to content

VPAAMP-345 subtitle SkipFragments result must not overwrite A/V remai…#1455

Open
pstroffolino wants to merge 2 commits into
dev_sprint_25_2from
feature/VPAAMP-345
Open

VPAAMP-345 subtitle SkipFragments result must not overwrite A/V remai…#1455
pstroffolino wants to merge 2 commits into
dev_sprint_25_2from
feature/VPAAMP-345

Conversation

@pstroffolino
Copy link
Copy Markdown
Contributor

…ning-seek

SeekInPeriod iterates all tracks in VIDEO/AUDIO/SUBTITLE order, assigning the SkipFragments return value to trackRemainingSeek for each iteration. When a subtitle track is present, its return value overwrites the A/V value as the last write. HandleSeekEOSAndPeriodTransition receives this subtitle-derived value as the carry-over seek offset and for the sign check that gates forward period transition.

Subtitle segment grids are often coarser than A/V (e.g. WebVTT on 10-second boundaries vs 2-second A/V segments). When the two grids disagree, the subtitle remaining-seek may be negative (seek overshot) even when the A/V seek correctly spans the period boundary, preventing a valid period transition. Conversely, a subtitle returning a positive remainder could carry an incorrect seek offset into the next period.

Fix: discard the subtitle SkipFragments return value; trackRemainingSeek is updated only from A/V tracks.

Unit test: SeekInPeriod_SubtitleResultNotUsedForPeriodTransition verifies the A/V-only seek path is not regressed.

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 PR fixes VPAAMP-345 in the DASH (MPD) stream abstraction: SeekInPeriod() previously overwrote the A/V SkipFragments() remaining-seek value with the subtitle track’s remaining-seek (processed last), which could incorrectly block or distort forward period transitions when subtitle segment boundaries differ from A/V.

Changes:

  • Update StreamAbstractionAAMP_MPD::SeekInPeriod() to discard the subtitle track’s SkipFragments() return value so period-transition decisions use only A/V remaining-seek.
  • Update the in-code comment to reflect the new “A/V-only” remaining-seek behavior.
  • Add a unit test intended to guard the behavior (but it currently does not exercise a subtitle-present scenario).

Reviewed changes

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

File Description
fragmentcollector_mpd.cpp Prevents subtitle SkipFragments() remaining-seek from overwriting the A/V remaining-seek used for period transition gating/carry-over.
test/utests/tests/StreamAbstractionAAMP_MPD/FetcherLoopTests.cpp Adds a SeekInPeriod()-related test and exposes a wrapper to invoke SeekInPeriod() from the fixture.

Comment thread test/utests/tests/StreamAbstractionAAMP_MPD/FetcherLoopTests.cpp
Comment thread test/utests/tests/StreamAbstractionAAMP_MPD/FetcherLoopTests.cpp Outdated
…ning-seek

SeekInPeriod iterates all tracks in VIDEO/AUDIO/SUBTITLE order, assigning the
SkipFragments return value to trackRemainingSeek for each iteration.  When a
subtitle track is present, its return value overwrites the A/V value as the
last write.  HandleSeekEOSAndPeriodTransition receives this subtitle-derived
value as the carry-over seek offset and for the sign check that gates forward
period transition.

Subtitle segment grids are often coarser than A/V (e.g. WebVTT on 10-second
boundaries vs 2-second A/V segments).  When the two grids disagree, the
subtitle remaining-seek may be negative (seek overshot) even when the A/V
seek correctly spans the period boundary, preventing a valid period transition.
Conversely, a subtitle returning a positive remainder could carry an incorrect
seek offset into the next period.

Fix: discard the subtitle SkipFragments return value; trackRemainingSeek is
updated only from A/V tracks.

Unit test: SeekInPeriod_SubtitleResultNotUsedForPeriodTransition verifies the
A/V-only seek path is not regressed.
- Remove unused GetNumberOfTracks() and GetMediaStreamContextAt()
  accessor helpers from TestableStreamAbstractionAAMP_MPD inner class.

- Add mAVVodManifest: two-period static VOD with video + audio, no
  subtitle adaptation set, 15 x 2 s segments per period (timescale
  2500, d=5000, startNumber=1 in both periods).

- Rewrite SeekInPeriod_SubtitleResultNotUsedForPeriodTransition:
  * Init with mAVVodManifest so A/V tracks have non-null representations.
  * Call SetNumberOfTracks(3) to inject the subtitle slot into the
    SeekInPeriod loop without a real subtitle pipeline.
  * mMediaStreamContext[eTRACK_SUBTITLE] is allocated but representation
    is null; SkipFragments returns 0.0 immediately from the null-rep guard,
    which is the corrupting value on a pre-fix build.
  * Seek to 35 s (5 s past the 30 s period 0 boundary).
  * Assert mCurrentPeriodIdx==1 (period transition occurred).
  * Assert fragmentDescriptor.Number==3: post-fix carry-over of 5 s skips
    two 2 s segments in period 1, landing at segment 3.  Pre-fix carry-over
    of 0 s leaves Number at 1, causing the assertion to fail.
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.

2 participants