am 25dc5f30: Merge "Don\'t coalesce more than 250ms worth of encoded data into a single codec input buffer. This currently only applies to the component OMX.TI.AAC.decode, it is the only one to support coalescing in the first place." into froyo

Merge commit '25dc5f30b2a8276c5790c7152a801fcd905c7281' into froyo-plus-aosp

* commit '25dc5f30b2a8276c5790c7152a801fcd905c7281':
  Don't coalesce more than 250ms worth of encoded data into a single codec input buffer.
This commit is contained in:
Andreas Huber
2010-04-20 14:52:57 -07:00
committed by Android Git Automerger

View File

@ -2004,9 +2004,12 @@ void OMXCodec::drainInputBuffer(BufferInfo *info) {
(const uint8_t *)srcBuffer->data() + srcBuffer->range_offset(),
srcBuffer->range_length());
int64_t lastBufferTimeUs;
CHECK(srcBuffer->meta_data()->findInt64(kKeyTime, &lastBufferTimeUs));
CHECK(timestampUs >= 0);
if (offset == 0) {
CHECK(srcBuffer->meta_data()->findInt64(kKeyTime, &timestampUs));
CHECK(timestampUs >= 0);
timestampUs = lastBufferTimeUs;
}
offset += srcBuffer->range_length();
@ -2019,6 +2022,13 @@ void OMXCodec::drainInputBuffer(BufferInfo *info) {
if (!(mQuirks & kSupportsMultipleFramesPerInputBuffer)) {
break;
}
int64_t coalescedDurationUs = lastBufferTimeUs - timestampUs;
if (coalescedDurationUs > 250000ll) {
// Don't coalesce more than 250ms worth of encoded data at once.
break;
}
}
if (n > 1) {