From 520c3c74d701532759e12c3b54d43b415afcb6d2 Mon Sep 17 00:00:00 2001 From: Weian Chen Date: Fri, 27 Jul 2012 04:55:11 -0400 Subject: [PATCH] OMXCodec: enhance error handling of OMX IL client 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 Signed-off-by: Tianmi Chen Signed-off-by: Weian Chen Signed-off-by: Shuo Gao Signed-off-by: Bruce Beare Signed-off-by: Jack Ren Author-tracking-BZ: 49066, 27054 --- media/libstagefright/OMXCodec.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index fde7ebf7fb..a6636a1dd9 100755 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -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) { -- 2.11.0