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

Commit 1aebc471 authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "Remove legacy hack to only drop frames every other late frame"

parents 5e9c3de5 2334d820
Loading
Loading
Loading
Loading
+6 −13
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@
#include <cutils/properties.h>

#define USE_SURFACE_ALLOC 1
#define FRAME_DROP_FREQ 0

namespace android {

@@ -1440,7 +1439,6 @@ void AwesomePlayer::onVideoEvent() {

    if (mFlags & FIRST_FRAME) {
        mFlags &= ~FIRST_FRAME;
        mSinceLastDropped = 0;
        mTimeSourceDeltaUs = ts->getRealTimeUs() - timeUs;
    }

@@ -1487,18 +1485,14 @@ void AwesomePlayer::onVideoEvent() {

        if (latenessUs > 40000) {
            // We're more than 40ms late.
            LOGV("we're late by %lld us (%.2f secs)", latenessUs, latenessUs / 1E6);
            if ( mSinceLastDropped > FRAME_DROP_FREQ)
            {
                LOGV("we're late by %lld us (%.2f secs) dropping one after %d frames", latenessUs, latenessUs / 1E6, mSinceLastDropped);
                mSinceLastDropped = 0;
            LOGV("we're late by %lld us (%.2f secs), dropping frame",
                 latenessUs, latenessUs / 1E6);
            mVideoBuffer->release();
            mVideoBuffer = NULL;

            postVideoEvent_l();
            return;
        }
        }

        if (latenessUs < -10000) {
            // We're more than 10ms early.
@@ -1515,7 +1509,6 @@ void AwesomePlayer::onVideoEvent() {
    }

    if (mVideoRenderer != NULL) {
        mSinceLastDropped++;
        mVideoRenderer->render(mVideoBuffer);
    }

+0 −1
Original line number Diff line number Diff line
@@ -163,7 +163,6 @@ private:

    uint32_t mFlags;
    uint32_t mExtractorFlags;
    uint32_t mSinceLastDropped;

    int64_t mTimeSourceDeltaUs;
    int64_t mVideoTimeUs;