Skip to content

Commit

Permalink
Recreate the DRM session
Browse files Browse the repository at this point in the history
  • Loading branch information
peak3d committed Feb 19, 2019
1 parent 6f5902d commit 4edd132
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion xbmc/platform/android/drm/MediaDrmCryptoSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,22 @@ bool CMediaDrmCryptoSession::Verify(const Buffer &macKeyId, const Buffer &messag
//Private stuff
bool CMediaDrmCryptoSession::OpenSession()
{
bool provisioned = false;
TRYAGAIN:
m_sessionId = new CharVecBuffer(m_mediaDrm->openSession());
if (xbmc_jnienv()->ExceptionCheck())
{
xbmc_jnienv()->ExceptionClear();
if (!ProvisionRequest())
if (provisioned || !ProvisionRequest())
{
delete m_sessionId, m_sessionId = nullptr;
return false;
}
else
{
provisioned = true;
goto TRYAGAIN;
}
}

m_cryptoSession = new CJNIMediaDrmCryptoSession(m_mediaDrm->getCryptoSession(*m_sessionId, m_cipherAlgo, m_macAlgo));
Expand Down

0 comments on commit 4edd132

Please sign in to comment.