OSDN Git Service

OMXCodec: enhance error handling of OMX IL client
authorWeian Chen <weian.chen@intel.com>
Fri, 27 Jul 2012 08:55:11 +0000 (04:55 -0400)
committerShuo Gao <shuo.gao@intel.com>
Fri, 31 Aug 2012 03:22:11 +0000 (11:22 +0800)
Original design doesn't handle event EMPTY_BUFFER_DONE and
FILL_BUFFER_DONE which leads to buffer status mess issue,
and in turn leads to mediaserver crash.
Here we will handle those 2 events anyway to fix this.

Change-Id: Ia90b46ea7ec6026d6fda5d33fef6773435788b04
Author: Tianmi Chen<tianmi.chen@intel.com>
Signed-off-by: Tianmi Chen<tianmi.chen@intel.com>
Signed-off-by: Weian Chen <weian.chen@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 49066, 27054

media/libstagefright/OMXCodec.cpp

index fde7ebf..a6636a1 100755 (executable)
@@ -2048,9 +2048,13 @@ int64_t OMXCodec::getDecodingTimeUs() {
 }
 
 void OMXCodec::on_message(const omx_message &msg) {
+    // even in error state, we still need to process EMPTY_BUFFER_DONE
+    // and FILL_BUFFER_DONE event, or we will run into mediaserver crash issue
     if (mState == ERROR) {
-        ALOGW("Dropping OMX message - we're in ERROR state.");
-        return;
+        if (msg.type == omx_message::EVENT) {
+            ALOGW("Dropping OMX message - we're in ERROR state.");
+            return;
+        }
     }
 
     switch (msg.type) {