diff options
author | Marco Nelissen <marcone@google.com> | 2014-09-19 09:28:34 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-19 09:28:34 +0000 |
commit | 7f3ff4afc1cead44bbebce054b6fe32e28bee807 (patch) | |
tree | 9f0cfa7affcf469419a7863f93e59f7cc5ee85a9 /media/libstagefright | |
parent | a32c696cf5d253f0f3be0cd65123d923d18236c1 (diff) | |
parent | b0ed4e3e482cbdc2fa6c7853526597f4ae3f0972 (diff) | |
download | frameworks_av-7f3ff4afc1cead44bbebce054b6fe32e28bee807.zip frameworks_av-7f3ff4afc1cead44bbebce054b6fe32e28bee807.tar.gz frameworks_av-7f3ff4afc1cead44bbebce054b6fe32e28bee807.tar.bz2 |
am b0ed4e3e: Merge "Always consider first buffer to be config" into lmp-dev
* commit 'b0ed4e3e482cbdc2fa6c7853526597f4ae3f0972':
Always consider first buffer to be config
Diffstat (limited to 'media/libstagefright')
-rw-r--r-- | media/libstagefright/codecs/aacdec/SoftAAC2.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp index 456be89..863b908 100644 --- a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp +++ b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp @@ -408,6 +408,9 @@ void SoftAAC2::configureDownmix() const { } bool SoftAAC2::outputDelayRingBufferPutSamples(INT_PCM *samples, int32_t numSamples) { + if (numSamples == 0) { + return true; + } if (mOutputDelayRingBufferWritePos + numSamples <= mOutputDelayRingBufferSize && (mOutputDelayRingBufferReadPos <= mOutputDelayRingBufferWritePos || mOutputDelayRingBufferReadPos > mOutputDelayRingBufferWritePos + numSamples)) { @@ -512,6 +515,11 @@ void SoftAAC2::onQueueFilled(OMX_U32 /* portIndex */) { OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader; mEndOfInput = (inHeader->nFlags & OMX_BUFFERFLAG_EOS) != 0; + + if (mInputBufferCount == 0 && !(inHeader->nFlags & OMX_BUFFERFLAG_CODECCONFIG)) { + ALOGE("first buffer should have OMX_BUFFERFLAG_CODECCONFIG set"); + inHeader->nFlags |= OMX_BUFFERFLAG_CODECCONFIG; + } if ((inHeader->nFlags & OMX_BUFFERFLAG_CODECCONFIG) != 0) { BufferInfo *inInfo = *inQueue.begin(); OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader; |