summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MediaCodec.cpp
diff options
context:
space:
mode:
authorWei Jia <wjia@google.com>2014-08-20 11:49:40 -0700
committerWei Jia <wjia@google.com>2014-08-22 17:32:41 -0700
commit5530f7a7f9dff5280be84f2675b3be081beb5540 (patch)
tree1cf2bddd9bbb6f2a60bf3f23779cb692c054c0f8 /media/libstagefright/MediaCodec.cpp
parent01047680ac57712303e259f485efd9cb97e9a99a (diff)
downloadframeworks_av-5530f7a7f9dff5280be84f2675b3be081beb5540.zip
frameworks_av-5530f7a7f9dff5280be84f2675b3be081beb5540.tar.gz
frameworks_av-5530f7a7f9dff5280be84f2675b3be081beb5540.tar.bz2
MediaCodec: handle errors during flushing.
Bug: 17068327 Bug: 13133027 Change-Id: I06caf79b90ebf55d6d7561cb82516c0b6c66f0e4
Diffstat (limited to 'media/libstagefright/MediaCodec.cpp')
-rw-r--r--media/libstagefright/MediaCodec.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index 814adab..76f730f 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -722,7 +722,7 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
mFlags |= kFlagSawMediaServerDie;
}
- bool sendErrorReponse = true;
+ bool sendErrorResponse = true;
switch (mState) {
case INITIALIZING:
@@ -749,7 +749,7 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
// Ignore the error, assuming we'll still get
// the shutdown complete notification.
- sendErrorReponse = false;
+ sendErrorResponse = false;
if (mFlags & kFlagSawMediaServerDie) {
// MediaServer died, there definitely won't
@@ -780,7 +780,7 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
case FLUSHED:
case STARTED:
{
- sendErrorReponse = false;
+ sendErrorResponse = false;
setStickyError(err);
postActivityNotificationIfPossible();
@@ -805,7 +805,7 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
default:
{
- sendErrorReponse = false;
+ sendErrorResponse = false;
setStickyError(err);
postActivityNotificationIfPossible();
@@ -831,7 +831,7 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
}
}
- if (sendErrorReponse) {
+ if (sendErrorResponse) {
PostReplyWithError(mReplyID, err);
}
break;
@@ -1118,7 +1118,11 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
case CodecBase::kWhatFlushCompleted:
{
- CHECK_EQ(mState, FLUSHING);
+ if (mState != FLUSHING) {
+ ALOGW("received FlushCompleted message in state %d",
+ mState);
+ break;
+ }
if (mFlags & kFlagIsAsync) {
setState(FLUSHED);