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

Commit dab59b5a authored by Andreas Huber's avatar Andreas Huber
Browse files

Remove legacy hack to only drop frames every other late frame

Change-Id: I197e568d292341c330efb394c41aa9af0e74b081
related-to-bug: 4203195
parent b7006fcd
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;