summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-11-11 22:00:35 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-11-11 22:00:37 +0000
commit745602d87607521f4fe84c4f3a6388fbdb6a867c (patch)
tree07aad629704dabc41fd18505383a71e1f7343c12 /media
parenta7e65b196bf7efb27daa36c8a783d9c57c9ffc03 (diff)
parent33223c4f97abb78fa8c92e1b8c817546f15d97e1 (diff)
downloadframeworks_av-745602d87607521f4fe84c4f3a6388fbdb6a867c.zip
frameworks_av-745602d87607521f4fe84c4f3a6388fbdb6a867c.tar.gz
frameworks_av-745602d87607521f4fe84c4f3a6388fbdb6a867c.tar.bz2
Merge "MediaCodec: Prevent stop() in the UNINITIALIZED state" into lmp-mr1-dev
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/MediaCodec.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index d7ddc89..11069e4 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -1349,9 +1349,12 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
uint32_t replyID;
CHECK(msg->senderAwaitsResponse(&replyID));
- if (!(mFlags & kFlagIsComponentAllocated) && mState != INITIALIZED
+ if (!((mFlags & kFlagIsComponentAllocated) && targetState == UNINITIALIZED) // See 1
+ && mState != INITIALIZED
&& mState != CONFIGURED && !isExecuting()) {
- // We may be in "UNINITIALIZED" state already and
+ // 1) Permit release to shut down the component if allocated.
+ //
+ // 2) We may be in "UNINITIALIZED" state already and
// also shutdown the encoder/decoder without the
// client being aware of this if media server died while
// we were being stopped. The client would assume that