Skip to content

Commit b288a1f

Browse files
vinodkadungothpaulpandian25vkadun208_comcastpstroffolinoCopilot
authored
VPLAY-11530: Increase in PLTV XSTPP-999 Failures (#679)
VPLAY-11530 [Charter XiOne | ES1][R38] Increase in PLTV XSTPP-999 Failures on both Xi1/ES1 - Reintroduced the condition check before calling clear() in clearDrmSession(), which was missed during the DRM refactoring - Apply suggestions from code review - Added mutex lock --------- Signed-off-by: Philip Stroffolino <[email protected]> Co-authored-by: paulpandian25 <[email protected]> Co-authored-by: vkadun208_comcast <[email protected]> Co-authored-by: pstroffolino <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent e5c0848 commit b288a1f

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

drm/AampDRMLicManager.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,10 +1450,17 @@ void AampDRMLicenseManager::clearDrmSession(bool forceClearSession)
14501450
{
14511451
mDrmSessionManager->clearDrmSession(forceClearSession);
14521452
for(int i = 0 ; i < mMaxDRMSessions;i++)
1453-
{
1454-
1455-
mLicenseDownloader[i].Clear();
1456-
}
1453+
{
1454+
bool isFailedKeyId = mDrmSessionManager->getFailedKeyIdStatus(i);
1455+
if(( mDrmSessionManager->drmSessionContexts != NULL && (isFailedKeyId || forceClearSession) ))
1456+
{
1457+
if(mDrmSessionManager->drmSessionContexts[i].drmSession != NULL)
1458+
{
1459+
AAMPLOG_INFO("Clearing Session %d, isFailedKeyId=%d, forceClearSession=%d",i, isFailedKeyId, forceClearSession);
1460+
mLicenseDownloader[i].Clear();
1461+
}
1462+
}
1463+
}
14571464
}
14581465

14591466
/**

middleware/drm/DrmSessionManager.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,20 @@ void DrmSessionManager::clearAccessToken()
170170
}
171171
}
172172

173+
/**
174+
* @brief Get the failed key ID status for a specific session
175+
*/
176+
bool DrmSessionManager::getFailedKeyIdStatus(int sessionIndex)
177+
{
178+
bool rc = false;
179+
std::lock_guard<std::mutex> guard(cachedKeyMutex);
180+
if (sessionIndex >= 0 && sessionIndex < mMaxDRMSessions && cachedKeyIDs)
181+
{
182+
rc = cachedKeyIDs[sessionIndex].isFailedKeyId;
183+
}
184+
return rc;
185+
}
186+
173187
/**
174188
* @brief Clean up the Session Data if license key acquisition failed or if LicenseCaching is false.
175189
*/

middleware/drm/DrmSessionManager.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,16 @@ class DrmSessionManager
301301
* @return void.
302302
*/
303303
void clearFailedKeyIds();
304+
305+
306+
/**
307+
* @fn getFailedKeyIdStatus
308+
*
309+
* @param sessionIndex - curl session index to check
310+
* @return bool - true if the key ID is marked as failed, false otherwise
311+
*/
312+
bool getFailedKeyIdStatus(int sessionIndex);
313+
304314
/**
305315
* @fn clearDrmSession
306316
*

0 commit comments

Comments
 (0)