summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-09-17 15:46:15 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-17 15:46:15 -0700
commit979d233237271c2acc0c3902508e208fce16a1c9 (patch)
treef18dd7a43f6e77723c288901fcf7317f8dcf971f /media
parent6d2969a09ffe48c1600fd48caeb6293a92e204c2 (diff)
parentab1b9612fc5ad9d98ff76b3eb18d9f48a295f13e (diff)
downloadframeworks_av-979d233237271c2acc0c3902508e208fce16a1c9.zip
frameworks_av-979d233237271c2acc0c3902508e208fce16a1c9.tar.gz
frameworks_av-979d233237271c2acc0c3902508e208fce16a1c9.tar.bz2
am 7bc600cb: am f98197a7: 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.
Merge commit '7bc600cb08394e60eef984843976d4f79e5d94e8' * commit '7bc600cb08394e60eef984843976d4f79e5d94e8': 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.
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 c215dff..4e79575 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -1466,6 +1466,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 37243ad..d89f54b 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(