diff options
author | Chong Zhang <chz@google.com> | 2014-09-11 14:16:54 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-11 14:16:54 +0000 |
commit | 10713e41173918f2a69a602889c28223a35a6d96 (patch) | |
tree | b46c4af29d8105f5065cf6d3238e6da822ff7b91 /media/libstagefright/MediaCodec.cpp | |
parent | d51c19cdca101fdc8464d3adae9c88f0be9a8a75 (diff) | |
parent | f2745669be588f8bc8fdb3dea60a12d91f6eb9c9 (diff) | |
download | frameworks_av-10713e41173918f2a69a602889c28223a35a6d96.zip frameworks_av-10713e41173918f2a69a602889c28223a35a6d96.tar.gz frameworks_av-10713e41173918f2a69a602889c28223a35a6d96.tar.bz2 |
am f2745669: am 74848665: Merge "fix failure in MediaCodecTest#testException" into lmp-dev
* commit 'f2745669be588f8bc8fdb3dea60a12d91f6eb9c9':
fix failure in MediaCodecTest#testException
Diffstat (limited to 'media/libstagefright/MediaCodec.cpp')
-rw-r--r-- | media/libstagefright/MediaCodec.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp index d5ec412..9d6bb9a 100644 --- a/media/libstagefright/MediaCodec.cpp +++ b/media/libstagefright/MediaCodec.cpp @@ -280,7 +280,20 @@ status_t MediaCodec::configure( } sp<AMessage> response; - return PostAndAwaitResponse(msg, &response); + status_t err = PostAndAwaitResponse(msg, &response); + + if (err != OK && err != INVALID_OPERATION) { + // MediaCodec now set state to UNINITIALIZED upon any fatal error. + // To maintain backward-compatibility, do a reset() to put codec + // back into INITIALIZED state. + // But don't reset if the err is INVALID_OPERATION, which means + // the configure failure is due to wrong state. + + ALOGE("configure failed with err 0x%08x, resetting...", err); + reset(); + } + + return err; } status_t MediaCodec::createInputSurface( |