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

Commit 4d842729 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Do not count underrun when the track is pausing or paused." into main

parents 5d024ddf 564d0eb9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -5741,8 +5741,9 @@ PlaybackThread::mixer_state MixerThread::prepareTracks_l(
            // don't count underruns that occur while stopping or pausing
            // or stopped which can occur when flush() is called while active
            size_t underrunFrames = 0;
            if (!(track->isStopping() || track->isPausing() || track->isStopped()) &&
                    recentUnderruns > 0) {
            if (!(track->isStopping() || track->isPausing()
                    || track->isStopped() || track->isPaused())
                && recentUnderruns > 0) {
                // FIXME fast mixer will pull & mix partial buffers, but we count as a full underrun
                underrunFrames = recentUnderruns * mFrameCount;
            }
+2 −1
Original line number Diff line number Diff line
@@ -1262,7 +1262,8 @@ status_t Track::getNextBuffer(AudioBufferProvider::Buffer* buffer)
    status_t status = mServerProxy->obtainBuffer(&buf);
    buffer->frameCount = buf.mFrameCount;
    buffer->raw = buf.mRaw;
    if (buf.mFrameCount == 0 && !isStopping() && !isStopped() && !isPaused() && !isOffloaded()) {
    if (buf.mFrameCount == 0 && !isStopping() && !isPausing()
        && !isStopped() && !isPaused() && !isOffloaded()) {
        ALOGV("%s(%d): underrun,  framesReady(%zu) < framesDesired(%zd), state: %d",
                __func__, mId, buf.mFrameCount, desiredFrames, (int)mState);
        mAudioTrackServerProxy->tallyUnderrunFrames(desiredFrames);