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

Commit d9ac4676 authored by Dorin Drimus's avatar Dorin Drimus Committed by Automerger Merge Worker
Browse files

Merge "Fix MediaCodec mBuffersInFlight size increased so large" into main am:...

Merge "Fix MediaCodec mBuffersInFlight size increased so large" into main am: a3dc3461 am: b3bd2d89 am: 712d256f am: e048f8b9 am: c058454a

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2732593



Change-Id: I4d36b5ec8cfe7d6a527ebcb61dd8b2f735996fd7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b7ceea40 c058454a
Loading
Loading
Loading
Loading
+11 −13
Original line number Diff line number Diff line
@@ -1792,24 +1792,22 @@ void MediaCodec::statsBufferSent(int64_t presentationUs, const sp<MediaCodecBuff
        mFramesInput++;
    }

    const int64_t nowNs = systemTime(SYSTEM_TIME_MONOTONIC);
    BufferFlightTiming_t startdata = { presentationUs, nowNs };

    {
    // mutex access to mBuffersInFlight and other stats
    Mutex::Autolock al(mLatencyLock);


    // XXX: we *could* make sure that the time is later than the end of queue
    // as part of a consistency check...
    if (!mTunneled) {
        const int64_t nowNs = systemTime(SYSTEM_TIME_MONOTONIC);
        BufferFlightTiming_t startdata = { presentationUs, nowNs };
        mBuffersInFlight.push_back(startdata);
    }

    if (mIsLowLatencyModeOn && mIndexOfFirstFrameWhenLowLatencyOn < 0) {
        mIndexOfFirstFrameWhenLowLatencyOn = mInputBufferCounter;
    }
    ++mInputBufferCounter;
}
}

// when we get a buffer back from the codec
void MediaCodec::statsBufferReceived(int64_t presentationUs, const sp<MediaCodecBuffer> &buffer) {