diff options
author | Wei Jia <wjia@google.com> | 2015-07-10 22:31:14 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-10 22:31:15 +0000 |
commit | 14ae2c0d1aa6e32e97cbb62dabb604820e1e5152 (patch) | |
tree | 3ebff38da2d0ceb77a003504e12c482d3c1fe995 /media | |
parent | b6b19ca71e41276190fcd97351a0d19fae75bd34 (diff) | |
parent | 3175d2babfcdcb64f41309157e0436d00375ae4b (diff) | |
download | frameworks_av-14ae2c0d1aa6e32e97cbb62dabb604820e1e5152.zip frameworks_av-14ae2c0d1aa6e32e97cbb62dabb604820e1e5152.tar.gz frameworks_av-14ae2c0d1aa6e32e97cbb62dabb604820e1e5152.tar.bz2 |
Merge "ACodec: call cancelBufferToNativeWindow() only when the buffer is owned by us." into mnc-dev
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 7d7c2a6..9206b5c 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -1063,9 +1063,11 @@ status_t ACodec::allocateOutputBuffersFromNativeWindow() { for (OMX_U32 i = cancelStart; i < cancelEnd; i++) { BufferInfo *info = &mBuffers[kPortIndexOutput].editItemAt(i); - status_t error = cancelBufferToNativeWindow(info); - if (err == 0) { - err = error; + if (info->mStatus == BufferInfo::OWNED_BY_US) { + status_t error = cancelBufferToNativeWindow(info); + if (err == 0) { + err = error; + } } } @@ -1152,9 +1154,11 @@ status_t ACodec::allocateOutputMetadataBuffers() { for (OMX_U32 i = 0; i < mBuffers[kPortIndexOutput].size(); i++) { BufferInfo *info = &mBuffers[kPortIndexOutput].editItemAt(i); - status_t error = cancelBufferToNativeWindow(info); - if (err == OK) { - err = error; + if (info->mStatus == BufferInfo::OWNED_BY_US) { + status_t error = cancelBufferToNativeWindow(info); + if (err == OK) { + err = error; + } } } |