diff options
author | Ronghua Wu <ronghuawu@google.com> | 2015-05-13 10:33:21 -0700 |
---|---|---|
committer | Ronghua Wu <ronghuawu@google.com> | 2015-05-13 10:58:58 -0700 |
commit | f35f6be32fb9e3ea040bb190b5414c7a5b988a6c (patch) | |
tree | 66fa78cd0faed47328eca829f6cbfe490e75bb76 | |
parent | 9ba21b9418d10ddcc39f08901e24fbf43d82b2bc (diff) | |
download | frameworks_av-f35f6be32fb9e3ea040bb190b5414c7a5b988a6c.zip frameworks_av-f35f6be32fb9e3ea040bb190b5414c7a5b988a6c.tar.gz frameworks_av-f35f6be32fb9e3ea040bb190b5414c7a5b988a6c.tar.bz2 |
libmediaplayerservice: unlock before trying to reclaim drm session.
Bug: 21086224
Change-Id: Icebd8eab70570e818ff7f5fc3a32e1801c3b92d2
-rw-r--r-- | media/libmediaplayerservice/Drm.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/Drm.cpp b/media/libmediaplayerservice/Drm.cpp index d55482d..a7f6f8b 100644 --- a/media/libmediaplayerservice/Drm.cpp +++ b/media/libmediaplayerservice/Drm.cpp @@ -358,7 +358,18 @@ status_t Drm::openSession(Vector<uint8_t> &sessionId) { status_t err = mPlugin->openSession(sessionId); if (err == ERROR_DRM_RESOURCE_BUSY) { bool retry = false; + mLock.unlock(); + // reclaimSession may call back to closeSession, since mLock is shared between Drm + // instances, we should unlock here to avoid deadlock. retry = DrmSessionManager::Instance()->reclaimSession(getCallingPid()); + mLock.lock(); + if (mInitCheck != OK) { + return mInitCheck; + } + + if (mPlugin == NULL) { + return -EINVAL; + } if (retry) { err = mPlugin->openSession(sessionId); } |