Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9553f2e authored by Andreas Huber's avatar Andreas Huber Committed by Android Git Automerger
Browse files

am 1e1edb2c: am 25dc5f30: Merge "Don\'t coalesce more than 250ms worth of...

am 1e1edb2c: 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 '1e1edb2c' into kraken

* commit '1e1edb2c':
  Don't coalesce more than 250ms worth of encoded data into a single codec input buffer.
parents bb331f73 1e1edb2c
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -2014,9 +2014,12 @@ void OMXCodec::drainInputBuffer(BufferInfo *info) {
               (const uint8_t *)srcBuffer->data() + srcBuffer->range_offset(),
               srcBuffer->range_length());

        if (offset == 0) {
            CHECK(srcBuffer->meta_data()->findInt64(kKeyTime, &timestampUs));
        int64_t lastBufferTimeUs;
        CHECK(srcBuffer->meta_data()->findInt64(kKeyTime, &lastBufferTimeUs));
        CHECK(timestampUs >= 0);

        if (offset == 0) {
            timestampUs = lastBufferTimeUs;
        }

        offset += srcBuffer->range_length();
@@ -2029,6 +2032,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) {