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

Commit bc5fe9ab authored by Praveen Chavan's avatar Praveen Chavan Committed by Lajos Molnar
Browse files

NuPlayer: Do not account eos frames in dropped-frame-counter

eos-only frames at the end are not rendered. However, these must
not be counted as dropped since they are empty eos outputs

Bug: 79493409
Change-Id: Idabaf5cbaaa990860a148bbc6ecafc85f053d5ef
parent 7bb4333f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -745,6 +745,7 @@ bool NuPlayer::Decoder::handleAnOutputBuffer(
    sp<AMessage> reply = new AMessage(kWhatRenderBuffer, this);
    reply->setSize("buffer-ix", index);
    reply->setInt32("generation", mBufferGeneration);
    reply->setSize("size", size);

    if (eos) {
        ALOGI("[%s] saw output EOS", mIsAudio ? "audio" : "video");
@@ -1127,6 +1128,7 @@ void NuPlayer::Decoder::onRenderBuffer(const sp<AMessage> &msg) {
    int32_t render;
    size_t bufferIx;
    int32_t eos;
    size_t size;
    CHECK(msg->findSize("buffer-ix", &bufferIx));

    if (!mIsAudio) {
@@ -1146,7 +1148,10 @@ void NuPlayer::Decoder::onRenderBuffer(const sp<AMessage> &msg) {
        CHECK(msg->findInt64("timestampNs", &timestampNs));
        err = mCodec->renderOutputBufferAndRelease(bufferIx, timestampNs);
    } else {
        if (!msg->findInt32("eos", &eos) || !eos ||
                !msg->findSize("size", &size) || size) {
            mNumOutputFramesDropped += !mIsAudio;
        }
        err = mCodec->releaseOutputBuffer(bufferIx);
    }
    if (err != OK) {