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

Commit d7290ab2 authored by Glenn Kasten's avatar Glenn Kasten Committed by android-build-merger
Browse files

Merge "Normal tracks use triple buffering if resampling" into nyc-dev

am: 9b04a022

* commit '9b04a022':
  Normal tracks use triple buffering if resampling

Change-Id: Ib57f537dd43eeb58289d12b5d43e26a2503f2db1
parents 47734c95 9b04a022
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1468,8 +1468,9 @@ status_t AudioTrack::createTrack_l()
            // notify every HAL buffer, regardless of the size of the track buffer
            maxNotificationFrames = afFrameCountHAL;
        } else {
            // For normal tracks, use double-buffering
            const int nBuffering = 2;
            // For normal tracks, use at least double-buffering if no sample rate conversion,
            // or at least triple-buffering if there is sample rate conversion
            const int nBuffering = mOriginalSampleRate == mAfSampleRate ? 2 : 3;
            maxNotificationFrames = frameCount / nBuffering;
        }
        if (mNotificationFramesAct == 0 || mNotificationFramesAct > maxNotificationFrames) {