diff options
Diffstat (limited to 'media/libstagefright/VideoFrameScheduler.cpp')
-rw-r--r-- | media/libstagefright/VideoFrameScheduler.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/media/libstagefright/VideoFrameScheduler.cpp b/media/libstagefright/VideoFrameScheduler.cpp index 5fe9bf9..c17faf3 100644 --- a/media/libstagefright/VideoFrameScheduler.cpp +++ b/media/libstagefright/VideoFrameScheduler.cpp @@ -257,8 +257,7 @@ void VideoFrameScheduler::PLL::prime(size_t numSamplesToUse) { mPhase = firstTime; } } - ALOGV("priming[%zu] phase:%lld period:%lld", - numSamplesToUse, (long long)mPhase, (long long)mPeriod); + ALOGV("priming[%zu] phase:%lld period:%lld ", numSamplesToUse, (long long)mPhase, (long long)mPeriod); } nsecs_t VideoFrameScheduler::PLL::addSample(nsecs_t time) { @@ -460,14 +459,16 @@ nsecs_t VideoFrameScheduler::schedule(nsecs_t renderTime) { mTimeCorrection -= mVsyncPeriod / 2; renderTime -= mVsyncPeriod / 2; nextVsyncTime -= mVsyncPeriod; - --vsyncsForLastFrame; + if (vsyncsForLastFrame > 0) + --vsyncsForLastFrame; } else if (mTimeCorrection < -correctionLimit && (vsyncsPerFrameAreNearlyConstant || vsyncsForLastFrame == minVsyncsPerFrame)) { // add a VSYNC mTimeCorrection += mVsyncPeriod / 2; renderTime += mVsyncPeriod / 2; nextVsyncTime += mVsyncPeriod; - ++vsyncsForLastFrame; + if (vsyncsForLastFrame < ULONG_MAX) + ++vsyncsForLastFrame; } ATRACE_INT("FRAME_VSYNCS", vsyncsForLastFrame); } |