summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MediaCodec.cpp
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2015-06-16 18:13:33 -0700
committerAndy Hung <hunga@google.com>2015-06-16 18:13:33 -0700
commitc6044a135324979e62cc59db9dbde8b11c4bb74b (patch)
treea08e7c3445ceb3cd6b2c0716ceb8abea85c7dd61 /media/libstagefright/MediaCodec.cpp
parentbd974011599b6d4ff47c1cee36d617f191dc0c2f (diff)
downloadframeworks_av-c6044a135324979e62cc59db9dbde8b11c4bb74b.zip
frameworks_av-c6044a135324979e62cc59db9dbde8b11c4bb74b.tar.gz
frameworks_av-c6044a135324979e62cc59db9dbde8b11c4bb74b.tar.bz2
MediaCodec: handle a spontaneous error while configuring
Allow the INITIALIZED and UNINITIALIZED state to prevent a CHECK() from aborting the thread. This state flexibility makes the handling for kWhatComponentConfigured similar to kWhatFlushCompleted. Bug: 21840990 Change-Id: I57e08cfb146b0b9a355061e4f9ffbe176f213cf6
Diffstat (limited to 'media/libstagefright/MediaCodec.cpp')
-rw-r--r--media/libstagefright/MediaCodec.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index e5b7202..b576cd9 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -1160,6 +1160,12 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
case CodecBase::kWhatComponentConfigured:
{
+ if (mState == UNINITIALIZED || mState == INITIALIZED) {
+ // In case a kWhatError message came in and replied with error,
+ // we log a warning and ignore.
+ ALOGW("configure interrupted by error, current state %d", mState);
+ break;
+ }
CHECK_EQ(mState, CONFIGURING);
// reset input surface flag