Skip to content

Destroy Rialto pipeline in Stop() instead of Configure() - #1846

Merged
anshephe merged 2 commits into
feature/VPLAY-12902from
feature/VPLAY-12902_destroy_pipeline
Aug 7, 2026
Merged

Destroy Rialto pipeline in Stop() instead of Configure()#1846
anshephe merged 2 commits into
feature/VPLAY-12902from
feature/VPLAY-12902_destroy_pipeline

Conversation

@anshephe

@anshephe anshephe commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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_pipeline in AampRialtoPlayer::Stop() and simplify pipeline recreation logic to key off !m_pipeline (removing m_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));

Comment thread direct-rialto/AampRialtoPlayer.cpp
Comment thread direct-rialto/AampRialtoMediaSource.h Outdated
Comment thread test/utests/tests/AampRialtoPlayerTests/AampRialtoPlayerTestCases.cpp Outdated
@anshephe
anshephe marked this pull request as ready for review August 7, 2026 11:27
@anshephe
anshephe requested a review from a team as a code owner August 7, 2026 11:27
@anshephe
anshephe merged commit 4f4aaee into feature/VPLAY-12902 Aug 7, 2026
2 checks passed
@anshephe
anshephe deleted the feature/VPLAY-12902_destroy_pipeline branch August 7, 2026 12:00
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