summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx/OMXNodeInstance.cpp
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-10-21 16:07:52 -0700
committerLajos Molnar <lajos@google.com>2014-10-21 16:14:11 -0700
commit30358faf33fb9b638257b017fadb4c5f7352d903 (patch)
tree9cf39ac9b04a8de88c5b1dbd40d2c8631efc2115 /media/libstagefright/omx/OMXNodeInstance.cpp
parent7de5ac1f067ec61f7ea424d5534cfd40987b11fa (diff)
downloadframeworks_av-30358faf33fb9b638257b017fadb4c5f7352d903.zip
frameworks_av-30358faf33fb9b638257b017fadb4c5f7352d903.tar.gz
frameworks_av-30358faf33fb9b638257b017fadb4c5f7352d903.tar.bz2
stagefright: try to free codec instance if MediaCodec.release hangs
Bug: 18033275 Change-Id: If86cd26566d7b75941976f37829bbec619800778
Diffstat (limited to 'media/libstagefright/omx/OMXNodeInstance.cpp')
-rw-r--r--media/libstagefright/omx/OMXNodeInstance.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp
index d07ec14..f9c84e2 100644
--- a/media/libstagefright/omx/OMXNodeInstance.cpp
+++ b/media/libstagefright/omx/OMXNodeInstance.cpp
@@ -149,6 +149,11 @@ static status_t StatusFromOMXError(OMX_ERRORTYPE err) {
status_t OMXNodeInstance::freeNode(OMXMaster *master) {
static int32_t kMaxNumIterations = 10;
+ // exit if we have already freed the node
+ if (mHandle == NULL) {
+ return OK;
+ }
+
// Transition the node from its current state all the way down
// to "Loaded".
// This ensures that all active buffers are properly freed even