Skip to content

Feature/vpaamp 411 debug#1604

Open
nebutler963 wants to merge 6 commits into
dev_sprint_25_2from
feature/VPAAMP-411_debug
Open

Feature/vpaamp 411 debug#1604
nebutler963 wants to merge 6 commits into
dev_sprint_25_2from
feature/VPAAMP-411_debug

Conversation

@nebutler963

@nebutler963 nebutler963 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

This fixes a race condition, where the clean up of the pipeline occasionally before the pipeline was successfully stopped. This lead to a crash.
https://ccp.sys.comcast.net/browse/VPAAMP-411

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 adjusts DRM session cleanup ordering across AAMP teardown and the CDMI decryptor plugin to reduce the risk of use-after-free during GStreamer pipeline disposal and asynchronous DRM cleanup.

Changes:

  • Move/centralize DRM session deactivation (notifyCleanup()) into PrivateInstanceAAMP::TeardownStream() after sink teardown, and remove earlier calls from HLS/MPD stream abstraction stop paths.
  • Proactively drop CDMI decryptor references to drmSession / sessionManager during dispose() to avoid stale pointer usage during teardown.

Reviewed changes

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

File Description
priv_aamp.cpp Adds DRM cleanup notification during teardown after stopping the sink.
middleware/gst-plugins/drm/gst/gstcdmidecryptor.cpp Nulls DRM session pointers in dispose() to reduce stale-pointer exposure during teardown.
fragmentcollector_mpd.cpp Removes DRM cleanup notification from MPD stop path (now handled in teardown).
fragmentcollector_hls.cpp Removes DRM cleanup notification from HLS stop path (now handled in teardown).

Comment on lines +259 to +263
// Nullify DRM session references before releasing GStreamer resources
// to prevent async DRM callbacks from accessing stale pointers
cdmidecryptor->drmSession = NULL;
cdmidecryptor->sessionManager = NULL;

Comment thread priv_aamp.cpp
Comment on lines +5798 to +5806
// Deactivate DRM session after pipeline teardown to avoid use-after-free race
// between GStreamer element disposal and async DRM session cleanup
if (!IsLocalAAMPTsb() && (ISCONFIGSET_PRIV(eAAMPConfig_UseSecManager) || ISCONFIGSET_PRIV(eAAMPConfig_UseFireboltSDK)))
{
if (mDRMLicenseManager)
{
mDRMLicenseManager->notifyCleanup();
}
}
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