diff options
author | Wei Jia <wjia@google.com> | 2015-07-09 23:17:33 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-09 23:17:33 +0000 |
commit | 11addc1d922efa0bf12e261481bba11024c7c7ab (patch) | |
tree | 3ef63806e227fbb22df56b5e77f0e3d16ea534ce /media/libstagefright/codecs/avcdec/SoftAVCDec.cpp | |
parent | 54c0659b9efa72d11997c590c4d377c44789c7fd (diff) | |
parent | fd866b3aa0d97375de08f8888b95669026c83361 (diff) | |
download | frameworks_av-11addc1d922efa0bf12e261481bba11024c7c7ab.zip frameworks_av-11addc1d922efa0bf12e261481bba11024c7c7ab.tar.gz frameworks_av-11addc1d922efa0bf12e261481bba11024c7c7ab.tar.bz2 |
Merge "SimpleSoftOMXComponent: change CHECK to error notification." into mnc-dev
Diffstat (limited to 'media/libstagefright/codecs/avcdec/SoftAVCDec.cpp')
-rw-r--r-- | media/libstagefright/codecs/avcdec/SoftAVCDec.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp b/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp index a616b40..aab3af7 100644 --- a/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp +++ b/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp @@ -641,6 +641,11 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) { if (!inQueue.empty()) { inInfo = *inQueue.begin(); inHeader = inInfo->mHeader; + if (inHeader == NULL) { + inQueue.erase(inQueue.begin()); + inInfo->mOwnedByUs = false; + continue; + } } else { break; } @@ -652,14 +657,21 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) { outHeader->nTimeStamp = 0; outHeader->nOffset = 0; - if (inHeader != NULL && (inHeader->nFlags & OMX_BUFFERFLAG_EOS)) { - mReceivedEOS = true; + if (inHeader != NULL) { if (inHeader->nFilledLen == 0) { inQueue.erase(inQueue.begin()); inInfo->mOwnedByUs = false; notifyEmptyBufferDone(inHeader); + + if (!(inHeader->nFlags & OMX_BUFFERFLAG_EOS)) { + continue; + } + + mReceivedEOS = true; inHeader = NULL; setFlushMode(); + } else if (inHeader->nFlags & OMX_BUFFERFLAG_EOS) { + mReceivedEOS = true; } } |