From c38fcfba95f711e5738e4c72bd5499317a2f30d9 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Thu, 12 Sep 2013 09:12:54 -0700 Subject: ACodec: fix flush/resume for decoder-output-meta-data mode When in decoder-output-meta-data mode, ACodec does not hold onto buffers, but they are either with the native window, or with the component/client. However, for flushing we did not release the discarded buffers back to native window (this makes sense because they will be resubmitted shortly.) This logic can be handled by the normal resubmission. Change-Id: Ic472b386422251515ef12f426e187f208f14decc Signed-off-by: Lajos Molnar Bug: 10621959 Bug: 10192533 --- media/libstagefright/ACodec.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'media') diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 2e55c4f..5c3abd0 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -2366,6 +2366,10 @@ void ACodec::waitUntilAllPossibleNativeWindowBuffersAreReturnedToUs() { while (countBuffersOwnedByNativeWindow() > (size_t)minUndequeuedBufs && dequeueBufferFromNativeWindow() != NULL) { + // these buffers will be submitted as regular buffers; account for this + if (mStoreMetaDataInOutputBuffers && mMetaDataBuffersToSubmit > 0) { + --mMetaDataBuffersToSubmit; + } } } @@ -4000,10 +4004,9 @@ void ACodec::ExecutingState::submitRegularOutputBuffers() { } void ACodec::ExecutingState::submitOutputBuffers() { + submitRegularOutputBuffers(); if (mCodec->mStoreMetaDataInOutputBuffers) { submitOutputMetaBuffers(); - } else { - submitRegularOutputBuffers(); } } -- cgit v1.1