mozilla-b2g/platform_frameworks_av — pull request #6 by BruceSunMozilla (2014-04-28 07:44:26+00:00)
Title: Bug1002338: Check mFilledBuffers before filling output buffers.

https://bugzilla.mozilla.org/show_bug.cgi?id=1002338

If BufferInfo::mStatus of one BufferInfo in OMXCode::mPortBuffers[kPortIndexOutput] is OWNED_BY_US, that means this BufferInfo is either an unused empty buffer hold by OMXCodec, or a ready-to-be-retrieved buffer filled with decoded data hold by OMXCodec.

In OMXCodec::fillOutputBuffers(), all BufferInfos with OWNED_BY_US status are sent to the underlying component for being filled with decoded data in the future.

However, OMXCodec should check whether BufferInfo contains decoded data already or not before sending it to the underlying component.

ref: https://bugzilla.mozilla.org/show_bug.cgi?id=990908#c19
ref: https://bug990908.bugzilla.mozilla.org/attachment.cgi?id=8407471