diff options
author | Andy Hung <hunga@google.com> | 2014-11-12 02:45:55 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2014-11-12 02:45:55 +0000 |
commit | fc70a810d18f13bdb04be3307aa2b282b0cdc5b0 (patch) | |
tree | 26cd9b42f80c3feee788150e5af5967404b79243 /media/libstagefright/MediaCodec.cpp | |
parent | 2ae8276201be9b2e5cd5150de6389264a578fcd9 (diff) | |
parent | 3584a1afb3f263a13d12cc2d8003101c74453ce3 (diff) | |
download | frameworks_av-fc70a810d18f13bdb04be3307aa2b282b0cdc5b0.zip frameworks_av-fc70a810d18f13bdb04be3307aa2b282b0cdc5b0.tar.gz frameworks_av-fc70a810d18f13bdb04be3307aa2b282b0cdc5b0.tar.bz2 |
am 745602d8: Merge "MediaCodec: Prevent stop() in the UNINITIALIZED state" into lmp-mr1-dev automerge: 8bc9b3a
automerge: 3584a1a
* commit '3584a1afb3f263a13d12cc2d8003101c74453ce3':
MediaCodec: Prevent stop() in the UNINITIALIZED state
Diffstat (limited to 'media/libstagefright/MediaCodec.cpp')
-rw-r--r-- | media/libstagefright/MediaCodec.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp index 673d375..3622eb7 100644 --- a/media/libstagefright/MediaCodec.cpp +++ b/media/libstagefright/MediaCodec.cpp @@ -1359,9 +1359,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 |