summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorPraveen Chavan <pchavan@codeaurora.org>2015-10-08 13:43:12 -0700
committerPraveen Chavan <pchavan@codeaurora.org>2015-10-08 13:47:32 -0700
commitd33b158b5ed85a6e43bf79c646cac72adce3c04f (patch)
tree6e98c9cf1614f59500b8a36763ae483b440d4064 /media/libstagefright/ACodec.cpp
parentb3f0834aa448d6b4bf8dbddaff4fbcefa3ede422 (diff)
downloadframeworks_av-d33b158b5ed85a6e43bf79c646cac72adce3c04f.zip
frameworks_av-d33b158b5ed85a6e43bf79c646cac72adce3c04f.tar.gz
frameworks_av-d33b158b5ed85a6e43bf79c646cac72adce3c04f.tar.bz2
Stagefright: Transition to uninitialized state after freeing node
If the component is force-released after timeout, there could be a race condition where component posted a message just before it was released. This posted message will cause ACodec to wrongly invoke OMX API on the component which was freed already. Move ACodec to uninitialized state where all component messages will be safely ignored. Change-Id: I71da7c7d021210fd6bed44761740161a5d8894e7 CRs-Fixed: 884165
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 43006f3..8f814d8 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -4611,6 +4611,7 @@ bool ACodec::BaseState::onMessageReceived(const sp<AMessage> &msg) {
ALOGI("[%s] forcing the release of codec",
mCodec->mComponentName.c_str());
status_t err = mCodec->mOMX->freeNode(mCodec->mNode);
+ mCodec->changeState(mCodec->mUninitializedState);
ALOGE_IF("[%s] failed to release codec instance: err=%d",
mCodec->mComponentName.c_str(), err);
sp<AMessage> notify = mCodec->mNotify->dup();