From 30358faf33fb9b638257b017fadb4c5f7352d903 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Tue, 21 Oct 2014 16:07:52 -0700 Subject: stagefright: try to free codec instance if MediaCodec.release hangs Bug: 18033275 Change-Id: If86cd26566d7b75941976f37829bbec619800778 --- media/libstagefright/omx/OMXNodeInstance.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'media/libstagefright/omx') 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 -- cgit v1.1