From f6f38287b97ec69b169387add6458f859b770e65 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Thu, 29 Nov 2012 13:49:07 -0800 Subject: Clear the sticky EOS flags when transitioning to LOADED state instead of transitioning _from_ UNINITIALIZED state. This makes codec instances reusable. Change-Id: I8f0c11923978ffee58b553a5ac59c740b0223c54 --- media/libstagefright/ACodec.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'media') diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index a135222..8f3dc6c 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -3106,11 +3106,6 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp &msg) { mCodec->mOMX = omx; mCodec->mNode = node; - mCodec->mPortEOS[kPortIndexInput] = - mCodec->mPortEOS[kPortIndexOutput] = false; - - mCodec->mInputEOSResult = OK; - { sp notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatComponentAllocated); @@ -3132,6 +3127,11 @@ ACodec::LoadedState::LoadedState(ACodec *codec) void ACodec::LoadedState::stateEntered() { ALOGV("[%s] Now Loaded", mCodec->mComponentName.c_str()); + mCodec->mPortEOS[kPortIndexInput] = + mCodec->mPortEOS[kPortIndexOutput] = false; + + mCodec->mInputEOSResult = OK; + if (mCodec->mShutdownInProgress) { bool keepComponentAllocated = mCodec->mKeepComponentAllocated; -- cgit v1.1