diff options
author | Andy Hung <hunga@google.com> | 2015-06-16 18:13:33 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2015-06-16 18:13:33 -0700 |
commit | c6044a135324979e62cc59db9dbde8b11c4bb74b (patch) | |
tree | a08e7c3445ceb3cd6b2c0716ceb8abea85c7dd61 /media/libstagefright/MediaCodec.cpp | |
parent | bd974011599b6d4ff47c1cee36d617f191dc0c2f (diff) | |
download | frameworks_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.cpp | 6 |
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 |