Destroy Rialto pipeline in Stop() instead of Configure() - #1846
Merged
anshephe merged 2 commits intoAug 7, 2026
Conversation
AampRialtoPlayer::Stop() now calls m_pipeline.reset() right after stop(), releasing the pipeline immediately rather than leaving it alive until the next Configure() overwrites it. ShouldRecreatePipeline() uses !m_pipeline instead of the now-redundant m_pipelineStopped flag. AampRialtoMediaSource::respondAbandonedRequest() treats a null pipeline as an expected post-Stop() condition (dropped with an INFO log) instead of an error, since a stale needData can legitimately arrive after Stop() destroys the pipeline. Updated AampRialtoPlayerTestCases.cpp: added Stop_DestroysPipeline, and fixed tests that asserted on m_mockPipelinePtr after Stop() (now a dangling pointer) to instead verify no crash on late needData.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Direct-Rialto playback teardown semantics so AampRialtoPlayer::Stop() immediately destroys the Rialto pipeline (instead of deferring destruction until the next Configure()), and adjusts post-Stop handling to treat late/stale needData notifications as an expected condition.
Changes:
- Destroy
m_pipelineinAampRialtoPlayer::Stop()and simplify pipeline recreation logic to key off!m_pipeline(removingm_pipelineStopped). - Treat a null pipeline in
AampRialtoMediaSource::respondAbandonedRequest()as an expected post-Stop state (log INFO and drop). - Update/add L1 tests to reflect immediate pipeline teardown and avoid dereferencing a now-dangling mock pipeline pointer after
Stop().
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/utests/tests/AampRialtoPlayerTests/AampRialtoPlayerTestCases.cpp | Adds/updates Stop-related tests for immediate pipeline destruction and safe handling of late needData. |
| direct-rialto/AampRialtoPlayer.h | Removes the m_pipelineStopped flag now made redundant by immediate pipeline reset. |
| direct-rialto/AampRialtoPlayer.cpp | Resets m_pipeline in Stop() and updates ShouldRecreatePipeline() to recreate when !m_pipeline. |
| direct-rialto/AampRialtoMediaSource.h | Documents new behavior when pipeline is null during abandoned request response. |
| direct-rialto/AampRialtoMediaSource.cpp | Logs INFO (not ERR) and drops abandoned requests when the pipeline is already gone. |
Suppressed comments (2)
test/utests/tests/AampRialtoPlayerTests/AampRialtoPlayerTestCases.cpp:1213
- This test no longer verifies that EOS flags are reset (it now only checks that a stale needData call after Stop() does not crash). Rename the test so it accurately reflects what is being validated.
// Stop() destroys the pipeline (m_mockPipelinePtr is now a dangling
// pointer - no EXPECT_CALL can be set against it), so it must not
// resurrect the EOS state and re-fire haveData(EOS, ...); the stale
// needData arriving after Stop() has nothing left to respond to and
// must be dropped safely rather than crashing.
test/utests/tests/AampRialtoPlayerTests/AampRialtoPlayerTestCases.cpp:1217
- Same as above: please document why this
sleep_for()is required for the test’s oracle (negative assertion / allow async processing). If it’s not required, consider removing it to reduce flakiness.
std::this_thread::sleep_for(std::chrono::milliseconds(20));
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.
AampRialtoPlayer::Stop() now calls m_pipeline.reset() right after stop(), releasing the pipeline immediately rather than leaving it alive until the next Configure() overwrites it. ShouldRecreatePipeline() uses !m_pipeline instead of the now-redundant m_pipelineStopped flag.
AampRialtoMediaSource::respondAbandonedRequest() treats a null pipeline as an expected post-Stop() condition (dropped with an INFO log) instead of an error, since a stale needData can legitimately arrive after Stop() destroys the pipeline.
Updated AampRialtoPlayerTestCases.cpp: added Stop_DestroysPipeline, and fixed tests that asserted on m_mockPipelinePtr after Stop() (now a dangling pointer) to instead verify no crash on late needData.