summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2013-10-28 14:59:21 -0700
committerLajos Molnar <lajos@google.com>2013-10-30 13:43:51 -0700
commit7fa015217e618265ff5a844cf6961ecc316c81a4 (patch)
tree0891bfc23870221cdb9705e79cbfcef07c79de3d
parentc76b9f52cf4e39f6943c53f5b3657dfee65857ac (diff)
downloadframeworks_av-7fa015217e618265ff5a844cf6961ecc316c81a4.zip
frameworks_av-7fa015217e618265ff5a844cf6961ecc316c81a4.tar.gz
frameworks_av-7fa015217e618265ff5a844cf6961ecc316c81a4.tar.bz2
Restore NuPlayer error and EOS handling
This was erroneously removed by commit a73c954 Change-Id: I4742339139e770f0181c99d427875897fd60b68e Signed-off-by: Lajos Molnar <lajos@google.com> Bug: 11413439
-rw-r--r--media/libstagefright/ACodec.cpp11
-rw-r--r--media/libstagefright/MediaCodec.cpp3
2 files changed, 10 insertions, 4 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 1adab38..92a5361 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -3072,11 +3072,16 @@ void ACodec::BaseState::onInputBufferFilled(const sp<AMessage> &msg) {
/* these are unfilled buffers returned by client */
CHECK(msg->findInt32("err", &err));
- ALOGV("[%s] saw error %d instead of an input buffer",
- mCodec->mComponentName.c_str(), err);
+ if (err == OK) {
+ /* buffers with no errors are returned on MediaCodec.flush */
+ mode = KEEP_BUFFERS;
+ } else {
+ ALOGV("[%s] saw error %d instead of an input buffer",
+ mCodec->mComponentName.c_str(), err);
+ eos = true;
+ }
buffer.clear();
- mode = KEEP_BUFFERS;
}
int32_t tmp;
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index e0686be..c36dd7c 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -1500,7 +1500,8 @@ void MediaCodec::returnBuffersToCodecOnPort(int32_t portIndex) {
info->mOwnedByClient = false;
if (portIndex == kPortIndexInput) {
- msg->setInt32("err", ERROR_END_OF_STREAM);
+ /* no error, just returning buffers */
+ msg->setInt32("err", OK);
}
msg->post();
}