summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-09-17 11:49:39 -0700
committerAndreas Huber <andih@google.com>2010-09-17 11:49:39 -0700
commitf98197a7274c2d7da647f52b3d8b0c74492139af (patch)
tree796d8ff26ab33b0d5d8b0ee5ff7bddd69d479427 /media
parent524e6f62c93e9947f3f9de386c6f6be7a3085d3c (diff)
downloadframeworks_base-f98197a7274c2d7da647f52b3d8b0c74492139af.zip
frameworks_base-f98197a7274c2d7da647f52b3d8b0c74492139af.tar.gz
frameworks_base-f98197a7274c2d7da647f52b3d8b0c74492139af.tar.bz2
Make sure the message dispatcher stays around until after OMX_FreeHandle is finished in case it posts some more messages during shutdown. Clear the source as soon as possible in OMXCodec's destructor.
Change-Id: I9c896cf07dea0c3201b6f074dbaf27e6d85cd784
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/OMXCodec.cpp2
-rw-r--r--media/libstagefright/omx/OMX.cpp8
2 files changed, 7 insertions, 3 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index b6710af..523b79c 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -1443,6 +1443,8 @@ void OMXCodec::setComponentRole() {
}
OMXCodec::~OMXCodec() {
+ mSource.clear();
+
CHECK(mState == LOADED || mState == ERROR);
status_t err = mOMX->freeNode(mNode);
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp
index 6de761f..c927da1 100644
--- a/media/libstagefright/omx/OMX.cpp
+++ b/media/libstagefright/omx/OMX.cpp
@@ -245,13 +245,15 @@ status_t OMX::freeNode(node_id node) {
CHECK(index >= 0);
mLiveNodes.removeItemsAt(index);
+ instance->observer()->asBinder()->unlinkToDeath(this);
+
+ status_t err = instance->freeNode(mMaster);
+
index = mDispatchers.indexOfKey(node);
CHECK(index >= 0);
mDispatchers.removeItemsAt(index);
- instance->observer()->asBinder()->unlinkToDeath(this);
-
- return instance->freeNode(mMaster);
+ return err;
}
status_t OMX::sendCommand(