diff options
author | Ronghua Wu <ronghuawu@google.com> | 2015-05-13 18:28:33 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-13 18:28:33 +0000 |
commit | 2e69a987ea5a6430c9804e1b59faa0e6ca45a43e (patch) | |
tree | 24d6828cbe11697e334ce76d7db61ae13cbfb332 /media/libmediaplayerservice | |
parent | 814463259cfc0b3c30535e6cba89a736f56c4a16 (diff) | |
parent | f35f6be32fb9e3ea040bb190b5414c7a5b988a6c (diff) | |
download | frameworks_av-2e69a987ea5a6430c9804e1b59faa0e6ca45a43e.zip frameworks_av-2e69a987ea5a6430c9804e1b59faa0e6ca45a43e.tar.gz frameworks_av-2e69a987ea5a6430c9804e1b59faa0e6ca45a43e.tar.bz2 |
Merge "libmediaplayerservice: unlock before trying to reclaim drm session." into mnc-dev
Diffstat (limited to 'media/libmediaplayerservice')
-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); } |